prevent ssh_auth.absent from running when test=True

fixes #29262
This commit is contained in:
Andreas Lutro 2015-11-30 11:53:06 +01:00
parent b225263279
commit febbfa792f

View file

@ -394,6 +394,18 @@ def absent(name,
'result': True,
'comment': ''}
if __opts__['test']:
ret['result'], ret['comment'] = _absent_test(
user,
name,
enc,
comment,
options or [],
source,
config,
)
return ret
# Extract Key from file if source is present
if source != '':
key = __salt__['cp.get_file_str'](
@ -438,18 +450,6 @@ def absent(name,
comment = comps[2]
ret['comment'] = __salt__['ssh.rm_auth_key'](user, name, config)
if __opts__['test']:
ret['result'], ret['comment'] = _absent_test(
user,
name,
enc,
comment,
options or [],
source,
config,
)
return ret
if ret['comment'] == 'User authorized keys file not present':
ret['result'] = False
return ret