Python 3: use six.text_type instead of unicode

Replace 'unicode' with six.text_type, everywhere but in module_utils.
This commit is contained in:
Marius Gedminas 2015-09-04 08:39:08 +03:00
parent 1840906f74
commit 37be9539ff
9 changed files with 20 additions and 14 deletions

View file

@ -19,7 +19,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from six import iteritems
from six import iteritems, text_type
from ansible.errors import AnsibleError
from ansible.executor.play_iterator import PlayIterator
@ -221,7 +221,7 @@ class StrategyModule(StrategyBase):
saved_name = task.name
display.debug("done copying, going to template now")
try:
task.name = unicode(templar.template(task.name, fail_on_undefined=False))
task.name = text_type(templar.template(task.name, fail_on_undefined=False))
display.debug("done templating")
except:
# just ignore any errors during task name templating,