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
3ffc2783
Commit
3ffc2783
authored
Sep 22, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't bomb out on handlers with undefined variables in their names
parent
4b0d52d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
lib/ansible/plugins/strategy/__init__.py
+11
-2
No files found.
lib/ansible/plugins/strategy/__init__.py
View file @
3ffc2783
...
...
@@ -24,8 +24,10 @@ from six import iteritems, text_type
import
time
from
jinja2.exceptions
import
UndefinedError
from
ansible
import
constants
as
C
from
ansible.errors
import
AnsibleError
,
AnsibleParserError
from
ansible.errors
import
AnsibleError
,
AnsibleParserError
,
AnsibleUndefinedVariable
from
ansible.executor.task_result
import
TaskResult
from
ansible.inventory.host
import
Host
from
ansible.inventory.group
import
Group
...
...
@@ -466,7 +468,14 @@ class StrategyBase:
for
handler
in
handler_block
.
block
:
handler_vars
=
self
.
_variable_manager
.
get_vars
(
loader
=
self
.
_loader
,
play
=
iterator
.
_play
,
task
=
handler
)
templar
=
Templar
(
loader
=
self
.
_loader
,
variables
=
handler_vars
)
handler_name
=
templar
.
template
(
handler
.
get_name
())
try
:
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
:
result
=
self
.
_do_handler_run
(
handler
,
handler_name
,
iterator
=
iterator
,
play_context
=
play_context
)
...
...
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