mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix bugs in config file parsing
This commit is contained in:
parent
95abf25bd2
commit
b70d74fa3a
2 changed files with 8 additions and 2 deletions
|
@ -16,7 +16,7 @@ class Master(object):
|
|||
'''
|
||||
def __init__(self):
|
||||
self.cli = self.__parse_cli()
|
||||
self.opts = salt.config.master_config(self.cli)
|
||||
self.opts = salt.config.master_config(self.cli['config'])
|
||||
|
||||
def __parse_cli(self):
|
||||
'''
|
||||
|
|
|
@ -3,6 +3,7 @@ All salt configuration loading and defaults should be in this module
|
|||
'''
|
||||
# Import python modules
|
||||
import os
|
||||
import sys
|
||||
import socket
|
||||
# Import third party libs
|
||||
import yaml
|
||||
|
@ -18,7 +19,12 @@ def minion_config(path):
|
|||
}
|
||||
|
||||
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')
|
||||
|
||||
opts['master_uri'] = 'tcp://' + opts['master'] + ':' + opts['master_port']
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue