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
3a2df329
Commit
3a2df329
authored
Jul 23, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak the way chained callbacks work
parent
dd6399b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
lib/ansible/runner/__init__.py
+20
-14
No files found.
lib/ansible/runner/__init__.py
View file @
3a2df329
...
...
@@ -435,7 +435,6 @@ class Runner(object):
# will be unneccessary as it can decide to daisychain via it's own module returns.
# and this function can be deleted.
options
=
utils
.
parse_kv
(
self
.
module_args
)
return
self
.
_execute_module
(
conn
,
tmp
,
'assemble'
,
self
.
module_args
,
inject
=
inject
)
.
daisychain
(
'file'
)
# *****************************************************
...
...
@@ -516,7 +515,7 @@ class Runner(object):
# *****************************************************
def
_executor_internal_inner
(
self
,
host
,
inject
,
port
):
def
_executor_internal_inner
(
self
,
host
,
inject
,
port
,
is_chained
=
False
):
''' decides how to invoke a module '''
# special non-user/non-fact variables:
...
...
@@ -564,19 +563,24 @@ class Runner(object):
else
:
result
=
self
.
_execute_async_module
(
conn
,
tmp
,
module_name
,
inject
=
inject
)
chained
=
Fals
e
result
.
result
[
'module'
]
=
self
.
module_nam
e
if
result
.
is_successful
()
and
'daisychain'
in
result
.
result
:
chained
=
True
self
.
module_name
=
result
.
result
[
'daisychain'
]
if
'daisychain_args'
in
result
.
result
:
self
.
module_args
=
result
.
result
[
'daisychain_args'
]
result2
=
self
.
_executor_internal_inner
(
host
,
inject
,
port
)
result2
=
self
.
_executor_internal_inner
(
host
,
inject
,
port
,
is_chained
=
True
)
result2
.
result
[
'module'
]
=
self
.
module_name
changed
=
False
# print "result1=%s" % result.result
# print "result2=%s" % result2.result
if
result
.
result
.
get
(
'changed'
,
False
)
or
result2
.
result
.
get
(
'changed'
,
False
):
changed
=
True
result
.
result
.
update
(
result2
.
result
)
result
.
result
[
'changed'
]
=
changed
# print "DEBUG=%s" % changed
result2
.
result
.
update
(
result
.
result
)
result2
.
result
[
'changed'
]
=
changed
result
=
result2
del
result
.
result
[
'daisychain'
]
# print "DEBUG2=%s" % result.result['changed']
self
.
_delete_remote_files
(
conn
,
tmp
)
conn
.
close
()
...
...
@@ -588,13 +592,15 @@ class Runner(object):
data
=
result
.
result
if
'item'
in
inject
:
result
.
result
[
'item'
]
=
inject
[
'item'
]
if
not
chained
:
if
'skipped'
in
data
:
self
.
callbacks
.
on_skipped
(
result
.
host
)
elif
not
result
.
is_successful
():
self
.
callbacks
.
on_failed
(
result
.
host
,
data
)
else
:
self
.
callbacks
.
on_ok
(
result
.
host
,
data
)
if
is_chained
:
# no callbacks
return
result
if
'skipped'
in
data
:
self
.
callbacks
.
on_skipped
(
result
.
host
)
elif
not
result
.
is_successful
():
self
.
callbacks
.
on_failed
(
result
.
host
,
data
)
else
:
self
.
callbacks
.
on_ok
(
result
.
host
,
data
)
return
result
# *****************************************************
...
...
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