mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-05 02:03:09 +00:00
Properly fail if slurp fails during fetch
This commit is contained in:
@@ -61,7 +61,9 @@ 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 not slurpres.get('failed', False):
|
||||
if slurpres.get('failed'):
|
||||
return slurpres
|
||||
else:
|
||||
if slurpres['encoding'] == 'base64':
|
||||
remote_data = base64.b64decode(slurpres['content'])
|
||||
if remote_data is not None:
|
||||
@@ -72,9 +74,6 @@ class ActionModule(ActionBase):
|
||||
remote_source = slurpres.get('source')
|
||||
if remote_source and remote_source != source:
|
||||
source = remote_source
|
||||
else:
|
||||
# FIXME: should raise an error here? the old code did nothing
|
||||
pass
|
||||
|
||||
# calculate the destination name
|
||||
if os.path.sep not in self._connection._shell.join_path('a', ''):
|
||||
|
||||
Reference in New Issue
Block a user