From 4957115e511582e440ada0153cc3d66d33700e47 Mon Sep 17 00:00:00 2001 From: sspans Date: Mon, 4 Nov 2013 10:37:36 +0100 Subject: [PATCH] only require absolute paths for hardlinks --- files/file | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/files/file b/files/file index 88c3c4d3242..b716610633e 100644 --- a/files/file +++ b/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