mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
Do not add state: absent when a non-existent path is returned (#51350)
Leave it up to the module to return the state in the results. I went through all the modules in files/ and only found one case where the module needed to return this. No other modules return paths that do not exists. Signed-off-by: Sam Doran <sdoran@redhat.com>
This commit is contained in:
parent
d65a91ea7e
commit
cc9c72d6f8
3 changed files with 4 additions and 4 deletions
|
@ -470,9 +470,9 @@ def ensure_absent(path):
|
|||
'path': path})
|
||||
|
||||
diff = initial_diff(path, 'absent', prev_state)
|
||||
result.update({'path': path, 'changed': True, 'diff': diff})
|
||||
result.update({'path': path, 'changed': True, 'diff': diff, 'state': 'absent'})
|
||||
else:
|
||||
result.update({'path': path, 'changed': False})
|
||||
result.update({'path': path, 'changed': False, 'state': 'absent'})
|
||||
|
||||
return result
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue