fix the config parsing for master and minon

This commit is contained in:
Thomas S Hatch 2011-03-03 12:06:45 -07:00
parent b70d74fa3a
commit 9aa2ebfe3c
2 changed files with 8 additions and 3 deletions

View File

@ -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):
'''

View File

@ -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