From 5f0e882d016748d1d16c0e54b8d78ab69bbf7f3a Mon Sep 17 00:00:00 2001 From: muffl0n Date: Wed, 19 Feb 2014 21:30:53 +0100 Subject: [PATCH 1/2] call expanduser for src and dest --- lib/ansible/runner/action_plugins/unarchive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/action_plugins/unarchive.py b/lib/ansible/runner/action_plugins/unarchive.py index 3e5f98ccae7..55e4519e5c6 100644 --- a/lib/ansible/runner/action_plugins/unarchive.py +++ b/lib/ansible/runner/action_plugins/unarchive.py @@ -46,8 +46,8 @@ class ActionModule(object): if complex_args: options.update(complex_args) options.update(utils.parse_kv(module_args)) - source = options.get('src', None) - dest = options.get('dest', None) + source = os.path.expanduser(options.get('src', None)) + dest = os.path.expanduser(options.get('dest', None)) copy = utils.boolean(options.get('copy', 'yes')) if source is None or dest is None: From b0f00cc0979b20316ea92f8eb2795189a10678a5 Mon Sep 17 00:00:00 2001 From: muffl0n Date: Wed, 19 Feb 2014 21:41:57 +0100 Subject: [PATCH 2/2] already call expanduser in action_plugin --- lib/ansible/runner/action_plugins/copy.py | 4 ++-- library/files/copy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/runner/action_plugins/copy.py b/lib/ansible/runner/action_plugins/copy.py index d76c72185de..d2d20406214 100644 --- a/lib/ansible/runner/action_plugins/copy.py +++ b/lib/ansible/runner/action_plugins/copy.py @@ -48,9 +48,9 @@ class ActionModule(object): if complex_args: options.update(complex_args) options.update(utils.parse_kv(module_args)) - source = options.get('src', None) + source = os.path.expanduser(options.get('src', None)) content = options.get('content', None) - dest = options.get('dest', None) + dest = os.path.expanduser(options.get('dest', None)) raw = utils.boolean(options.get('raw', 'no')) force = utils.boolean(options.get('force', 'yes')) diff --git a/library/files/copy b/library/files/copy index d961764772a..50ebbb14c04 100644 --- a/library/files/copy +++ b/library/files/copy @@ -113,8 +113,8 @@ def main(): add_file_common_args=True, ) - src = os.path.expanduser(module.params['src']) - dest = os.path.expanduser(module.params['dest']) + src = module.params['src'] + dest = module.params['dest'] backup = module.params['backup'] force = module.params['force'] original_basename = module.params.get('original_basename',None)