From 926776f4cdaba12f22802e7ac4ca7dd2d030ef31 Mon Sep 17 00:00:00 2001 From: TuanLAF Date: Thu, 7 Jul 2016 14:03:51 +0700 Subject: Replace unicode with six.text_type The Unicode type is 'unicode' in Python 2 and 'str' on Python 3. This patch replaces unicode with six.text_type to make Nova compatible with Python 2 and Python 3. Blueprint nova-python3 Change-Id: I9e883798129ee3ea692e63cf0466b9cfd400a01d --- nova/virt/xenapi/volume_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/virt') diff --git a/nova/virt/xenapi/volume_utils.py b/nova/virt/xenapi/volume_utils.py index 739a9ca47c..b16ddad192 100644 --- a/nova/virt/xenapi/volume_utils.py +++ b/nova/virt/xenapi/volume_utils.py @@ -51,7 +51,7 @@ def parse_sr_info(connection_data, description=''): sr_identity = "%s/%s/%s" % (params['target'], params['port'], params['targetIQN']) # PY2 can only support taking an ascii string to uuid5 - if six.PY2 and isinstance(sr_identity, unicode): + if six.PY2 and isinstance(sr_identity, six.text_type): sr_identity = sr_identity.encode('utf-8') sr_uuid = str(uuid.uuid5(SR_NAMESPACE, sr_identity)) else: -- cgit v1.2.1