Merge pull request #40115 from DarkKnightCZ/ssh-40114

Mark ssh_auth.present state as failure when public key is invalid
This commit is contained in:
Mike Place 2017-03-17 10:35:04 -06:00 committed by GitHub
commit 9d7cdbfac3

View File

@ -356,9 +356,9 @@ def present(
ret['comment'] = ('Failed to add the ssh key. Is the home '
'directory available, and/or does the key file '
'exist?')
elif data == 'invalid':
elif data == 'invalid' or data == 'Invalid public key':
ret['result'] = False
ret['comment'] = 'Invalid public ssh key, most likely has spaces'
ret['comment'] = 'Invalid public ssh key, most likely has spaces or invalid syntax'
return ret