mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Enable better error output for bad authentications
This commit is contained in:
parent
ffd9dd616c
commit
b184517dca
1 changed files with 9 additions and 2 deletions
|
@ -167,10 +167,17 @@ class Auth(object):
|
|||
+ ' public key for this minion on the Salt Master'\
|
||||
+ ' and restart this minion.\nOr restart the Salt'\
|
||||
+ ' Master in open mode to clean out the keys.'
|
||||
sys.stderr.write(err)
|
||||
sys.stderr.write(err + '\n')
|
||||
sys.exit(42)
|
||||
if not self.verify_master(payload['pub_key'], payload['token']):
|
||||
return auth
|
||||
m_pub_fn = os.path.join(self.opts['pki_dir'], 'master.pub')
|
||||
err = 'The Salt Master server\'s public key did not authenticate!'\
|
||||
+ '\nIf you are confident that you are connecting to a valid'\
|
||||
+ ' Salt Master, then remove the master public key and'\
|
||||
+ ' restart the Salt Minion.\nThe master public key can be'\
|
||||
+ ' found at:\n' + m_pub_fn
|
||||
sys.stderr.write(err + '\n')
|
||||
sys.exit(42)
|
||||
auth['aes'] = self.decrypt_aes(payload['aes'])
|
||||
auth['publish_port'] = payload['publish_port']
|
||||
return auth
|
||||
|
|
Loading…
Add table
Reference in a new issue