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

fix conversion from file to hardlink when force=yes

Signed-off-by: Dave Simons <dave@inuits.eu>
This commit is contained in:
Dave Simons 2013-10-22 10:46:45 +02:00
parent 4f13967386
commit 4d4518ed52

View file

@ -231,7 +231,7 @@ def main():
module.exit_json(path=path, changed=True) module.exit_json(path=path, changed=True)
if prev_state != 'absent' and prev_state != state: if prev_state != 'absent' and prev_state != state:
if not (force and (prev_state == 'file' or prev_state == 'directory') and state == 'link') and state != 'touch': if not (force and (prev_state == 'file' or prev_state == 'directory') and (state in ('link', 'hard')) and state != 'touch':
module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, src)) module.fail_json(path=path, msg='refusing to convert between %s and %s for %s' % (prev_state, state, src))
if prev_state == 'absent' and state == 'absent': if prev_state == 'absent' and state == 'absent':