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
89159951
Commit
89159951
authored
Feb 26, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix name of a task containing a template causing traceback
Workaround for #10321 Need to fix better in v2
parent
825dd25d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
lib/ansible/playbook/__init__.py
+13
-1
test/integration/Makefile
+3
-3
No files found.
lib/ansible/playbook/__init__.py
View file @
89159951
...
...
@@ -476,13 +476,25 @@ class PlayBook(object):
else
:
name
=
task
.
name
self
.
callbacks
.
on_task_start
(
template
(
play
.
basedir
,
name
,
task
.
module_vars
,
lookup_fatal
=
False
,
filter_fatal
=
False
),
is_handler
)
try
:
# v1 HACK: we don't have enough information to template many names
# at this point. Rather than making this work for all cases in
# v1, just make this degrade gracefully. Will fix in v2
name
=
template
(
play
.
basedir
,
name
,
task
.
module_vars
,
lookup_fatal
=
False
,
filter_fatal
=
False
)
except
:
pass
self
.
callbacks
.
on_task_start
(
name
,
is_handler
)
if
hasattr
(
self
.
callbacks
,
'skip_task'
)
and
self
.
callbacks
.
skip_task
:
ansible
.
callbacks
.
set_task
(
self
.
callbacks
,
None
)
ansible
.
callbacks
.
set_task
(
self
.
runner_callbacks
,
None
)
return
True
# template ignore_errors
# TODO: Is this needed here? cond is templated again in
# check_conditional after some more manipulations.
# TODO: we don't have enough information here to template cond either
# (see note on templating name above)
cond
=
template
(
play
.
basedir
,
task
.
ignore_errors
,
task
.
module_vars
,
expand_lists
=
False
)
task
.
ignore_errors
=
utils
.
check_conditional
(
cond
,
play
.
basedir
,
task
.
module_vars
,
fail_on_undefined
=
C
.
DEFAULT_UNDEFINED_VAR_BEHAVIOR
)
...
...
test/integration/Makefile
View file @
89159951
...
...
@@ -21,7 +21,7 @@ VAULT_PASSWORD_FILE = vault-password
CONSUL_RUNNING
:=
$(
shell
python consul_running.py
)
all
:
parsing test_var_precedence unicode non_destructive destructive includes check_mode test_hash test_handlers test_group_by test_vault test_tags
all
:
parsing test_var_precedence unicode non_destructive destructive includes check_mode test_hash test_handlers test_group_by test_vault test_tags
test_templating_settings
parsing
:
ansible-playbook bad_parsing.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
$(CREDENTIALS_ARG)
-vvv
$(TEST_FLAGS)
--tags
prepare,common,scenario1
;
[
$$
?
-eq
3
]
...
...
@@ -39,8 +39,8 @@ unicode:
# Test the start-at-task flag #9571
ansible-playbook unicode.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
-v
--start-at-task
'*¶'
-e
'start_at_task=True'
$(TEST_FLAGS)
mine
:
ansible-playbook
mine
.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
$(CREDENTIALS_ARG)
-v
$(TEST_FLAGS)
test_templating_settings
:
ansible-playbook
test_templating_settings
.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
$(CREDENTIALS_ARG)
-v
$(TEST_FLAGS)
non_destructive
:
ansible-playbook non_destructive.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
$(CREDENTIALS_ARG)
-v
$(TEST_FLAGS)
...
...
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