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
a3e913da
Commit
a3e913da
authored
Sep 29, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't assume handlers exist in the same role (if any)
Fixes #12536
parent
8095b027
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
lib/ansible/executor/process/result.py
+0
-3
lib/ansible/playbook/included_file.py
+1
-1
lib/ansible/plugins/strategy/__init__.py
+10
-3
No files found.
lib/ansible/executor/process/result.py
View file @
a3e913da
...
...
@@ -142,9 +142,6 @@ class ResultProcess(multiprocessing.Process):
# So, per the docs, we reassign the list so the proxy picks up and
# notifies all other threads
for
notify
in
result_item
[
'_ansible_notify'
]:
if
result
.
_task
.
_role
:
role_name
=
result
.
_task
.
_role
.
get_name
()
notify
=
"
%
s :
%
s"
%
(
role_name
,
notify
)
self
.
_send_result
((
'notify_handler'
,
result
,
notify
))
# now remove the notify field from the results, as its no longer needed
result_item
.
pop
(
'_ansible_notify'
)
...
...
lib/ansible/playbook/included_file.py
View file @
a3e913da
...
...
@@ -48,7 +48,7 @@ class IncludedFile:
for
res
in
results
:
if
res
.
_host
.
name
in
tqm
.
_failed_hosts
:
raise
AnsibleError
(
"host is failed, not including files"
)
continue
if
res
.
_task
.
action
==
'include'
:
if
res
.
_task
.
loop
:
...
...
lib/ansible/plugins/strategy/__init__.py
View file @
a3e913da
...
...
@@ -237,6 +237,7 @@ class StrategyBase:
if
task_result
.
_host
not
in
self
.
_notified_handlers
[
handler_name
]:
self
.
_notified_handlers
[
handler_name
]
.
append
(
task_result
.
_host
)
self
.
_display
.
vv
(
"NOTIFIED HANDLER
%
s"
%
(
handler_name
,))
elif
result
[
0
]
==
'register_host_var'
:
# essentially the same as 'set_host_var' below, however we
...
...
@@ -447,15 +448,21 @@ class StrategyBase:
handler_vars
=
self
.
_variable_manager
.
get_vars
(
loader
=
self
.
_loader
,
play
=
iterator
.
_play
,
task
=
handler
)
templar
=
Templar
(
loader
=
self
.
_loader
,
variables
=
handler_vars
)
try
:
handler_name
=
templar
.
template
(
handler
.
get_name
())
# first we check with the full result of get_name(), which may
# include the role name (if the handler is from a role). If that
# is not found, we resort to the simple name field, which doesn't
# have anything extra added to it.
handler_name
=
templar
.
template
(
handler
.
name
)
if
handler_name
not
in
self
.
_notified_handlers
:
handler_name
=
templar
.
template
(
handler
.
get_name
())
except
(
UndefinedError
,
AnsibleUndefinedVariable
):
# We skip this handler due to the fact that it may be using
# a variable in the name that was conditionally included via
# set_fact or some other method, and we don't want to error
# out unnecessarily
continue
should_run
=
handler_name
in
self
.
_notified_handlers
and
len
(
self
.
_notified_handlers
[
handler_name
])
if
should_run
:
if
handler_name
in
self
.
_notified_handlers
and
len
(
self
.
_notified_handlers
[
handler_name
])
:
result
=
self
.
_do_handler_run
(
handler
,
handler_name
,
iterator
=
iterator
,
play_context
=
play_context
)
if
not
result
:
break
...
...
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