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:
Thomas S Hatch 2013-04-19 23:42:05 -07:00
commit bb4defab0c

View File

@ -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: