Skip to content

Commit

Permalink
Fix local client configuration loading paths
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch45 committed Mar 31, 2011
1 parent 1cf6a0b commit b5de9c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 10 additions & 1 deletion salt/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ def __parse(self):
help='Execute a salt command query, this can be used to find'\
+ ' previous function calls, of to look up a call that'\
+ ' occured at a specific time.')
parser.add_option('-c',
'--config',
default='/etc/salt/master',
dest='conf_file',
help='The location of the salt master configuration file,'\
+ ' the salt master settings are required to know where'\
+ ' the connections are; default=/etc/salt/master')

options, args = parser.parse_args()

Expand All @@ -80,6 +87,8 @@ def __parse(self):
opts['pcre'] = options.pcre
opts['list'] = options.list_
opts['facter'] = options.facter
opts['conf_file'] = options.conf_file

if options.query:
opts['query'] = options.query
if len(args) < 1:
Expand All @@ -102,7 +111,7 @@ def run(self):
'''
Execute the salt command line
'''
local = salt.client.LocalClient()
local = salt.client.LocalClient(self.opts['conf_file'])
if self.opts.has_key('query'):
print local.find_cmd(self.opts['cmd'])
else:
Expand Down
5 changes: 3 additions & 2 deletions salt/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __init__(self, opts):
self.key = self.__prep_key()
self.crypticle = salt.crypt.Crypticle(self.opts['aes'])
# Make a client
self.local = salt.client.LocalClient()
self.local = salt.client.LocalClient(self.opts['conf_file'])

def __prep_key(self):
'''
Expand Down Expand Up @@ -336,7 +336,8 @@ def _cluster_load(self):
pub = os.path.join(minion_dir, host)
minions[host] = open(pub, 'r').read()
if self.opts['cluster_mode'] == 'full':
master_pem = open(os.path.join(self.opts['pki_dir'], 'master.pem')).read()
master_pem = open(os.path.join(self.opts['pki_dir'],
'master.pem')).read()
return [minions,
master_conf,
master_pem,
Expand Down

0 comments on commit b5de9c9

Please sign in to comment.