1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Correct bug reporting the diff when state=touch as absent

This commit is contained in:
Toshio Kuratomi 2018-05-14 14:52:11 -07:00
parent c8ac02d6f2
commit 7d2ec56a99

View file

@ -335,6 +335,7 @@ def execute_touch(path, follow):
'path': path})
elif prev_state == 'link' and follow:
# Update the timestamp of the pointed to file
b_link_target = os.readlink(b_path)
try:
os.utime(b_link_target, None)
@ -348,7 +349,7 @@ def execute_touch(path, follow):
' hardlinks (%s is %s)' % (path, prev_state)})
# Update the attributes on the file
diff = initial_diff(path, 'absent', prev_state)
diff = initial_diff(path, 'touch', prev_state)
file_args = module.load_file_common_arguments(module.params)
try:
module.set_fs_attributes_if_different(file_args, True, diff, expand=False)