Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #53 from s0undt3ch/issues/52
Browse files Browse the repository at this point in the history
Provide `salt-api`'s configuration defaults. Refs #52.
  • Loading branch information
whiteinge committed Mar 4, 2013
2 parents d649bd2 + eb77df1 commit 77c2987
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions saltapi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
Manage configuration files in salt-api
'''

# Import python libs
import os

# Import salt libs
import salt.config

DEFAULT_API_OPTS = {
# ----- Salt master settings overridden by Salt-API --------------------->
'pidfile': '/var/run/salt-api.pid',
'logfile': '/var/log/api',
# <---- Salt master settings overridden by Salt-API ----------------------
}


def api_config(path):
'''
Read in the salt master config file and add additional configs that
need to be stubbed out for salt-api
'''
opts = {}

opts = salt.config.master_config(path)

if 'include' in opts:
opts = salt.config.include_config(opts, path)
# Let's grab a copy of salt's master default opts
defaults = salt.config.DEFAULT_MASTER_OPTS
# Let's override them with salt-api's required defaults
defaults.update(DEFAULT_API_OPTS)

return opts
return salt.config.master_config(path, defaults=defaults)

0 comments on commit 77c2987

Please sign in to comment.