Merge pull request #4632 from simonsd/devel

refusing to convert between file and hard when force=yes
This commit is contained in:
Michael DeHaan 2013-10-27 08:32:34 -07:00
commit 0f18ac92b4

View file

@ -231,7 +231,7 @@ def main():
module.exit_json(path=path, changed=True)
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))
if prev_state == 'absent' and state == 'absent':