From ff3f6e16642e40666eeba816a480511f52af6750 Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Sat, 8 Jul 2017 11:42:41 +0700 Subject: [PATCH] Replace unicode with six.text_type Change-Id: I5a645ecfc4e0367bf257970f5aa750c23e2594d2 Refer: https://wiki.openstack.org/wiki/Python3#Common_patterns Partial-Implements: blueprint support-python-35 --- nova/virt/zun/driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/virt/zun/driver.py b/nova/virt/zun/driver.py index a7c97dc95..47eaaafc9 100644 --- a/nova/virt/zun/driver.py +++ b/nova/virt/zun/driver.py @@ -234,8 +234,8 @@ class DockerDriver(driver.ComputeDriver): self._stop_firewall(instance, network_info) def _encode_utf8(self, value): - if six.PY2 and not isinstance(value, unicode): - value = unicode(value) + if six.PY2 and not isinstance(value, six.text_type): + value = six.text_type(value) return value.encode('utf-8') def _find_container_by_instance(self, instance):