mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix readding and updating logfile and pidfile config options for Salt API
This commit is contained in:
parent
f47253c21b
commit
45dffa292f
1 changed files with 5 additions and 13 deletions
|
@ -3285,24 +3285,16 @@ def client_config(path, env_var='SALT_CLIENT_CONFIG', defaults=None):
|
|||
|
||||
def api_config(path):
|
||||
'''
|
||||
Read in the salt master config file and add additional configs that
|
||||
Read in the Salt Master config file and add additional configs that
|
||||
need to be stubbed out for salt-api
|
||||
'''
|
||||
# Let's grab a copy of salt's master opts
|
||||
opts = client_config(path, defaults=DEFAULT_MASTER_OPTS)
|
||||
# Let's override them with salt-api's required defaults
|
||||
api_opts = {
|
||||
'log_file': opts.get(
|
||||
'api_logfile', os.path.join(
|
||||
opts['root_dir'], DEFAULT_API_OPTS['api_logfile'].lstrip('/')
|
||||
)
|
||||
),
|
||||
'pidfile': opts.get(
|
||||
'api_pidfile', os.path.join(
|
||||
opts['root_dir'], DEFAULT_API_OPTS['api_pidfile'].lstrip('/')
|
||||
)
|
||||
),
|
||||
}
|
||||
api_opts = DEFAULT_API_OPTS
|
||||
api_opts.update({
|
||||
'pidfile': opts.get('api_pidfile', DEFAULT_API_OPTS['api_pidfile']),
|
||||
})
|
||||
opts.update(api_opts)
|
||||
return opts
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue