Merge pull request #49262 from bloomberg/short-circuit

extend #48588 to cover SyncAuth class
This commit is contained in:
Daniel Wallace 2018-08-22 14:04:08 -05:00 committed by GitHub
commit 879c3ad7b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)