only require absolute paths for hardlinks
This commit is contained in:
parent
1381f80e47
commit
4957115e51
1 changed files with 7 additions and 6 deletions
13
files/file
13
files/file
|
@ -280,13 +280,14 @@ def main():
|
|||
|
||||
elif state in ['link','hard']:
|
||||
|
||||
if os.path.isabs(src):
|
||||
abs_src = src
|
||||
else:
|
||||
module.fail_json(msg="absolute paths are required")
|
||||
if state == 'hard':
|
||||
if os.path.isabs(src):
|
||||
abs_src = src
|
||||
else:
|
||||
module.fail_json(msg="absolute paths are required")
|
||||
|
||||
if not os.path.exists(abs_src) and not force:
|
||||
module.fail_json(path=path, src=src, msg='src file does not exist')
|
||||
if not os.path.exists(abs_src) and not force:
|
||||
module.fail_json(path=path, src=src, msg='src file does not exist')
|
||||
|
||||
if prev_state == 'absent':
|
||||
changed = True
|
||||
|
|
Loading…
Reference in a new issue