summaryrefslogtreecommitdiff
path: root/nova/virt
diff options
context:
space:
mode:
authorTuanLAF <tuanla@vn.fujitsu.com>2016-07-07 14:03:51 +0700
committerTuanLAF <tuanla@vn.fujitsu.com>2016-07-07 14:03:51 +0700
commit926776f4cdaba12f22802e7ac4ca7dd2d030ef31 (patch)
tree7f1d1554a012cc245ef65c224f46d68417475afe /nova/virt
parent3e96b0fde010c3f800a539eec5376c3c379c8594 (diff)
downloadnova-926776f4cdaba12f22802e7ac4ca7dd2d030ef31.tar.gz
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
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/volume_utils.py2
1 files changed, 1 insertions, 1 deletions
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: