Minor cleanup

This commit is contained in:
Jeff Schroeder 2012-07-01 16:50:46 -07:00
parent d6cff0e698
commit d81f208204

View File

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