mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Minor cleanup
This commit is contained in:
parent
d6cff0e698
commit
d81f208204
@ -82,14 +82,16 @@ class LocalClient(object):
|
||||
'''
|
||||
Read in the rotating master authentication key
|
||||
'''
|
||||
keyfile = os.path.join(self.opts['cachedir'], '.root_key')
|
||||
# Make sure all key parent directories are accessible
|
||||
user = self.opts.get('user', 'root')
|
||||
salt.utils.verify.check_parent_dirs(keyfile, user)
|
||||
|
||||
try:
|
||||
keyfile = os.path.join(self.opts['cachedir'], '.root_key')
|
||||
# Make sure all key parent directories are accessible
|
||||
user = self.opts.get('user', 'root')
|
||||
salt.utils.verify.check_parent_dirs(keyfile, user)
|
||||
with open(keyfile, 'r') as KEY:
|
||||
return KEY.read()
|
||||
except (OSError, IOError):
|
||||
# In theory, this should never get hit. Belt & suspenders baby!
|
||||
raise SaltClientError(('Problem reading the salt root key. Are'
|
||||
' you root?'))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user