mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +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,
|
'result': True,
|
||||||
'comment': ''}
|
'comment': ''}
|
||||||
|
|
||||||
|
# Get just the key
|
||||||
|
name = name.split(' ')[0]
|
||||||
|
|
||||||
if __opts__['test']:
|
if __opts__['test']:
|
||||||
check = __salt__['ssh.check_key'](
|
check = __salt__['ssh.check_key'](
|
||||||
user,
|
user,
|
||||||
@ -228,7 +231,7 @@ def absent(name, user, config='.ssh/authorized_keys'):
|
|||||||
[],
|
[],
|
||||||
config)
|
config)
|
||||||
if check == 'update' or check == 'exists':
|
if check == 'update' or check == 'exists':
|
||||||
ret['return'] = None
|
ret['result'] = None
|
||||||
ret['comment'] = 'Key {0} is set for removal'.format(name)
|
ret['comment'] = 'Key {0} is set for removal'.format(name)
|
||||||
return ret
|
return ret
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user