From 66a2f2923e482022399d2ae3f3f72b4f883086fa Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 31 Aug 2015 16:36:07 -0400 Subject: [PATCH] Look for proper values in slurp result during fetch with become enabled --- lib/ansible/plugins/action/fetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/fetch.py b/lib/ansible/plugins/action/fetch.py index 8c9a2ed16d..297126c413 100644 --- a/lib/ansible/plugins/action/fetch.py +++ b/lib/ansible/plugins/action/fetch.py @@ -61,7 +61,7 @@ class ActionModule(ActionBase): remote_data = None if remote_checksum in ('1', '2') or self._play_context.become: slurpres = self._execute_module(module_name='slurp', module_args=dict(src=source), task_vars=task_vars, tmp=tmp) - if slurpres.get('rc') == 0: + if not slurpres.get('failed', False): if slurpres['encoding'] == 'base64': remote_data = base64.b64decode(slurpres['content']) if remote_data is not None: