From d81f2082047f3e0adca285cba14c1e00904e67e6 Mon Sep 17 00:00:00 2001 From: Jeff Schroeder Date: Sun, 1 Jul 2012 16:50:46 -0700 Subject: [PATCH] Minor cleanup --- salt/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/salt/client.py b/salt/client.py index 1652eed197..760112997d 100644 --- a/salt/client.py +++ b/salt/client.py @@ -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?'))