When using Salt multi-master, if we encouter a salt master that has not accepted the minion key yet we should not exit right away, rather continue on and try the next salt master available in the list.

This commit is contained in:
Gareth J. Greenaway 2018-07-13 10:29:59 -07:00
parent 13f67335f3
commit 8d1551c5fb
No known key found for this signature in database
GPG key ID: 10B62F8A7CAD7A41

View file

@ -520,9 +520,18 @@ class AsyncAuth(object):
error = SaltClientError('Detect mode is on')
break
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):
log.debug('=== opts %s ===', self.opts['master'])
error = SaltClientError('Minion failed to authenticate'
'with the master, has the 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))
yield tornado.gen.sleep(acceptance_wait_time)