mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Use to_unicode instead of str()
This commit is contained in:
parent
0480b44f50
commit
5fa49a9ad8
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
from ansible.plugins.action import ActionBase
|
from ansible.plugins.action import ActionBase
|
||||||
from ansible.utils.boolean import boolean
|
from ansible.utils.boolean import boolean
|
||||||
|
from ansible.utils.unicode import to_unicode
|
||||||
|
|
||||||
class ActionModule(ActionBase):
|
class ActionModule(ActionBase):
|
||||||
''' Print statements during execution '''
|
''' Print statements during execution '''
|
||||||
|
@ -43,7 +43,7 @@ class ActionModule(ActionBase):
|
||||||
results = self._templar.template(self._task.args['var'], convert_bare=True)
|
results = self._templar.template(self._task.args['var'], convert_bare=True)
|
||||||
if type(self._task.args['var']) in (list, dict):
|
if type(self._task.args['var']) in (list, dict):
|
||||||
# If var is a list or dict, use the type as key to display
|
# If var is a list or dict, use the type as key to display
|
||||||
result[str(type(self._task.args['var']))] = results
|
result[to_unicode(type(self._task.args['var']))] = results
|
||||||
else:
|
else:
|
||||||
if results == self._task.args['var']:
|
if results == self._task.args['var']:
|
||||||
results = "VARIABLE IS NOT DEFINED!"
|
results = "VARIABLE IS NOT DEFINED!"
|
||||||
|
|
Loading…
Reference in a new issue