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):