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:
parent
c8ac02d6f2
commit
7d2ec56a99
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue