Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
fca27c29
Commit
fca27c29
authored
Aug 31, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly fail if slurp fails during fetch
parent
66a2f292
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
lib/ansible/plugins/action/fetch.py
+3
-4
No files found.
lib/ansible/plugins/action/fetch.py
View file @
fca27c29
...
@@ -61,7 +61,9 @@ class ActionModule(ActionBase):
...
@@ -61,7 +61,9 @@ class ActionModule(ActionBase):
remote_data
=
None
remote_data
=
None
if
remote_checksum
in
(
'1'
,
'2'
)
or
self
.
_play_context
.
become
:
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
)
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'
:
if
slurpres
[
'encoding'
]
==
'base64'
:
remote_data
=
base64
.
b64decode
(
slurpres
[
'content'
])
remote_data
=
base64
.
b64decode
(
slurpres
[
'content'
])
if
remote_data
is
not
None
:
if
remote_data
is
not
None
:
...
@@ -72,9 +74,6 @@ class ActionModule(ActionBase):
...
@@ -72,9 +74,6 @@ class ActionModule(ActionBase):
remote_source
=
slurpres
.
get
(
'source'
)
remote_source
=
slurpres
.
get
(
'source'
)
if
remote_source
and
remote_source
!=
source
:
if
remote_source
and
remote_source
!=
source
:
source
=
remote_source
source
=
remote_source
else
:
# FIXME: should raise an error here? the old code did nothing
pass
# calculate the destination name
# calculate the destination name
if
os
.
path
.
sep
not
in
self
.
_connection
.
_shell
.
join_path
(
'a'
,
''
):
if
os
.
path
.
sep
not
in
self
.
_connection
.
_shell
.
join_path
(
'a'
,
''
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment