mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #4550 from basepi/sshfix4170
Fix ssh_auth.absent to check only the key, not the whole key line
This commit is contained in:
commit
bb4defab0c
@ -219,6 +219,9 @@ def absent(name, user, config='.ssh/authorized_keys'):
|
||||
'result': True,
|
||||
'comment': ''}
|
||||
|
||||
# Get just the key
|
||||
name = name.split(' ')[0]
|
||||
|
||||
if __opts__['test']:
|
||||
check = __salt__['ssh.check_key'](
|
||||
user,
|
||||
@ -228,7 +231,7 @@ def absent(name, user, config='.ssh/authorized_keys'):
|
||||
[],
|
||||
config)
|
||||
if check == 'update' or check == 'exists':
|
||||
ret['return'] = None
|
||||
ret['result'] = None
|
||||
ret['comment'] = 'Key {0} is set for removal'.format(name)
|
||||
return ret
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user