mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Correct bug reporting the diff when state=touch as absent
This commit is contained in:
@@ -335,6 +335,7 @@ def execute_touch(path, follow):
|
|||||||
'path': path})
|
'path': path})
|
||||||
|
|
||||||
elif prev_state == 'link' and follow:
|
elif prev_state == 'link' and follow:
|
||||||
|
# Update the timestamp of the pointed to file
|
||||||
b_link_target = os.readlink(b_path)
|
b_link_target = os.readlink(b_path)
|
||||||
try:
|
try:
|
||||||
os.utime(b_link_target, None)
|
os.utime(b_link_target, None)
|
||||||
@@ -348,7 +349,7 @@ def execute_touch(path, follow):
|
|||||||
' hardlinks (%s is %s)' % (path, prev_state)})
|
' hardlinks (%s is %s)' % (path, prev_state)})
|
||||||
|
|
||||||
# Update the attributes on the file
|
# 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)
|
file_args = module.load_file_common_arguments(module.params)
|
||||||
try:
|
try:
|
||||||
module.set_fs_attributes_if_different(file_args, True, diff, expand=False)
|
module.set_fs_attributes_if_different(file_args, True, diff, expand=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user