From ecf7d8c9ee7f4dff4a7a0ee51bb31c3667006f75 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 22 Sep 2015 01:29:32 -0400 Subject: [PATCH] Fix relative path bug in copy action Without rebreaking #12055 Fixes #ansible-modules-core/2098 --- lib/ansible/plugins/action/copy.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/plugins/action/copy.py b/lib/ansible/plugins/action/copy.py index ad6e21fe57b..ecb1775a99f 100644 --- a/lib/ansible/plugins/action/copy.py +++ b/lib/ansible/plugins/action/copy.py @@ -105,6 +105,8 @@ class ActionModule(ActionBase): for file in files: full_path = os.path.join(base_path, file) rel_path = full_path[sz:] + if rel_path.startswith('/'): + rel_path = rel_path[1:] source_files.append((full_path, rel_path)) # If it's recursive copy, destination is always a dir,