diff --git a/heat/engine/dependencies.py b/heat/engine/dependencies.py index d38ace08d4..a57a13432d 100644 --- a/heat/engine/dependencies.py +++ b/heat/engine/dependencies.py @@ -89,7 +89,7 @@ class Node(object): def __unicode__(self): '''Return a human-readable string representation of the node.''' - text = '{%s}' % ', '.join(unicode(n) for n in self) + text = '{%s}' % ', '.join(six.text_type(n) for n in self) return encodeutils.safe_decode(text) def __repr__(self): @@ -148,7 +148,7 @@ class Graph(collections.defaultdict): def __unicode__(self): '''Convert the graph to a human-readable string.''' - pairs = ('%s: %s' % (unicode(k), unicode(v)) + pairs = ('%s: %s' % (six.text_type(k), six.text_type(v)) for k, v in six.iteritems(self)) text = '{%s}' % ', '.join(pairs) return encodeutils.safe_decode(text) @@ -245,7 +245,7 @@ class Dependencies(object): ''' Return a human-readable string representation of the dependency graph ''' - return unicode(self._graph) + return six.text_type(self._graph) def __repr__(self): '''Return a string representation of the object.''' diff --git a/heat/engine/resource.py b/heat/engine/resource.py index 4277efd039..f6e2826ae5 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -391,10 +391,10 @@ class Resource(object): if self.resource_id: text = '%s "%s" [%s] %s' % (self.__class__.__name__, self.name, self.resource_id, - unicode(self.stack)) + six.text_type(self.stack)) else: text = '%s "%s" %s' % (self.__class__.__name__, self.name, - unicode(self.stack)) + six.text_type(self.stack)) else: text = '%s "%s"' % (self.__class__.__name__, self.name) return encodeutils.safe_decode(text) @@ -1014,14 +1014,14 @@ class Resource(object): :results: the id or name of the resource. ''' if self.resource_id is not None: - return unicode(self.resource_id) + return six.text_type(self.resource_id) else: - return unicode(self.name) + return six.text_type(self.name) def physical_resource_name_or_FnGetRefId(self): res_name = self.physical_resource_name() if res_name is not None: - return unicode(res_name) + return six.text_type(res_name) else: return Resource.FnGetRefId(self) diff --git a/heat/engine/scheduler.py b/heat/engine/scheduler.py index dde536011b..7fd3532656 100644 --- a/heat/engine/scheduler.py +++ b/heat/engine/scheduler.py @@ -122,7 +122,7 @@ class ExceptionGroup(Exception): for ex in self.exceptions]).encode('utf-8') def __unicode__(self): - return unicode(map(unicode, self.exceptions)) + return six.text_type(map(six.text_type, self.exceptions)) class TaskRunner(object):