mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Do not convert Nonetype to "None" (#17261)
If someone use a task with a empty name like this: - name: command: true This will result in displaying 'None' as a task name instead of 'command'.
This commit is contained in:
parent
1139d61d59
commit
a30f545a62
2 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.six import iteritems, text_type
|
||||
from ansible.compat.six import iteritems
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.executor.play_iterator import PlayIterator
|
||||
|
@ -238,7 +238,7 @@ class StrategyModule(StrategyBase):
|
|||
saved_name = task.name
|
||||
display.debug("done copying, going to template now")
|
||||
try:
|
||||
task.name = text_type(templar.template(task.name, fail_on_undefined=False))
|
||||
task.name = to_unicode(templar.template(task.name, fail_on_undefined=False), nonstring='empty')
|
||||
display.debug("done templating")
|
||||
except:
|
||||
# just ignore any errors during task name templating,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue