extend #488588 to cover SyncAuth class

the original fix was only covered asyncauth, but the syncauth method overrode
the fix. This patch duplicates it so behavior should be consistent in both
codepaths.
This commit is contained in:
Matt Phillips 2018-08-22 12:54:00 -04:00
parent 395bae6486
commit a3594db10f

View file

@ -1097,9 +1097,17 @@ class SAuth(AsyncAuth):
creds = self.sign_in(channel=channel)
if creds == 'retry':
if self.opts.get('caller'):
print('Minion failed to authenticate with the master, '
'has the minion key been accepted?')
sys.exit(2)
# We have a list of masters, so we should break
# and try the next one in the list.
if self.opts.get('local_masters', None):
error = SaltClientError('Minion failed to authenticate'
' with the master, has the '
'minion key been accepted?')
break
else:
print('Minion failed to authenticate with the master, '
'has the minion key been accepted?')
sys.exit(2)
if acceptance_wait_time:
log.info('Waiting {0} seconds before retry.'.format(acceptance_wait_time))
time.sleep(acceptance_wait_time)