Fix incorrect logic in exception check

This commit is contained in:
Erik Johnson 2018-04-17 16:51:26 -05:00
parent fed5041c5f
commit 6ba66cca41
No known key found for this signature in database
GPG Key ID: 5E5583C437808F3F

View File

@ -567,13 +567,12 @@ class MinionBase(object):
break break
except SaltClientError as exc: except SaltClientError as exc:
last_exc = exc last_exc = exc
pki_dirname = os.path.dirname(opts['pki_dir']) if exc.strerror.startswith('Could not access'):
if exc.strerror.startswith( msg = (
'Failed to initiate connection with Master ' 'Failed to initiate connection with Master '
'{0} because the Minion could not access {1}. ' '{0}: check ownership/permissions. Error '
'Check ownership/permissions'.format( 'message: {1}'.format(opts['master'], exc)
opts['master'], pki_dirname)): )
msg = exc.strerror
else: else:
msg = ('Master {0} could not be reached, trying ' msg = ('Master {0} could not be reached, trying '
'next master (if any)'.format(opts['master'])) 'next master (if any)'.format(opts['master']))