mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 08:35:21 +00:00
fix the config parsing for master and minon
This commit is contained in:
parent
b70d74fa3a
commit
9aa2ebfe3c
@ -55,7 +55,7 @@ class Minion(object):
|
||||
'''
|
||||
def __init__(self):
|
||||
self.cli = self.__parse_cli()
|
||||
self.opts = salt.config.minion_config(self.cli)
|
||||
self.opts = salt.config.minion_config(self.cli['config'])
|
||||
|
||||
def __parse_cli(self):
|
||||
'''
|
||||
|
@ -22,7 +22,7 @@ def minion_config(path):
|
||||
try:
|
||||
opts.update(yaml.load(open(path, 'r')))
|
||||
except:
|
||||
err = 'The master configuration file did not parse correctly,'\
|
||||
err = 'The minon configuration file did not parse correctly,'\
|
||||
+ ' please check your configuration file.\nUsing defaults'
|
||||
sys.stderr.write(err + '\n')
|
||||
|
||||
@ -37,6 +37,11 @@ def master_config(path):
|
||||
opts = {}
|
||||
|
||||
if os.path.isfile(path):
|
||||
opts.update(yaml.load(open(path, 'r')))
|
||||
try:
|
||||
opts.update(yaml.load(open(path, 'r')))
|
||||
except:
|
||||
err = 'The master configuration file did not parse correctly,'\
|
||||
+ ' please check your configuration file.\nUsing defaults'
|
||||
sys.stderr.write(err + '\n')
|
||||
|
||||
return opts
|
||||
|
Loading…
Reference in New Issue
Block a user