mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes #4767 detect hard links and set state in add_file_info
This commit is contained in:
parent
f4b59fe285
commit
dc4d589ce0
1 changed files with 2 additions and 0 deletions
|
@ -511,6 +511,8 @@ class AnsibleModule(object):
|
||||||
kwargs['state'] = 'link'
|
kwargs['state'] = 'link'
|
||||||
elif os.path.isdir(path):
|
elif os.path.isdir(path):
|
||||||
kwargs['state'] = 'directory'
|
kwargs['state'] = 'directory'
|
||||||
|
elif os.stat(path).st_nlink > 1:
|
||||||
|
kwargs['state'] = 'hard'
|
||||||
else:
|
else:
|
||||||
kwargs['state'] = 'file'
|
kwargs['state'] = 'file'
|
||||||
if HAVE_SELINUX and self.selinux_enabled():
|
if HAVE_SELINUX and self.selinux_enabled():
|
||||||
|
|
Loading…
Reference in a new issue