From 08c1f96e4bec7e704a4936b9fc9b9347d6c50bab Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 3 Aug 2012 07:02:31 -0400 Subject: [PATCH] Fix some subtle behavior of how the get_url module chains into the file module, plus blend the results of daisy chain operations in the correct order, so the file module results overlay the original module results, not the other way around (which keeps any failure msg's intact) --- lib/ansible/runner/__init__.py | 6 +++--- library/get_url | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 356cd30890ad4a..2572490594cb30 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -587,9 +587,9 @@ def _executor_internal_inner(self, host, inject, port, is_chained=False): changed = False if result.result.get('changed',False) or result2.result.get('changed',False): changed = True - result2.result.update(result.result) - result2.result['changed'] = changed - result = result2 + result.result.update(result2.result) + result.result['changed'] = changed + del result.result['daisychain'] self._delete_remote_files(conn, tmp) diff --git a/library/get_url b/library/get_url index 038362ff3104e8..52cf640a63f1e0 100755 --- a/library/get_url +++ b/library/get_url @@ -64,6 +64,8 @@ def url_do_get(module, url, dest): else: actualdest = dest info['daisychain_args'] = module.params + info['daisychain_args']['state'] = 'file' + info['daisychain_args']['dest'] = actualdest info['actualdest'] = actualdest request = urllib2.Request(url)