diff options
author | Victor Stinner <vstinner@redhat.com> | 2015-05-04 19:02:51 +0200 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2015-05-12 12:31:20 +0200 |
commit | 67eedf4fa020362d847dc14aec331db5c30a1173 (patch) | |
tree | 6c2d266bb6061667c69f075b99a8dbee2028daa1 /nova/api/openstack/wsgi.py | |
parent | e8707aa3b5747be91a837030bb8258eafd5df8d8 (diff) | |
download | nova-67eedf4fa020362d847dc14aec331db5c30a1173.tar.gz |
Replace unicode with six.text_type
The Unicode type is 'unicode' in Python 2 and 'str' on Python 3: replace
unicode with six.text_type to make Nova compatible with Python 2 and
Python 3.
This patch was generated by the following tool (revision e760664379c3) with the
operation "unicode":
https://bitbucket.org/haypo/misc/src/tip/python/sixer.py
Manual change:
* Replace "isinstance(value, str) or isinstance(value, unicode)"
with "isinstance(value, six.string_types)" in nova/api/ec2/ec2utils.py
* Revert changes in strings in:
- nova/compute/api.py
- nova/hacking/checks.py
- nova/tests/unit/api/openstack/test_wsgi.py
- nova/utils.py
* Revert changes in nova/tests/unit/test_hacking.py: tests must use
"unicode()". The nova.hacking module will probably need other changes
to support Python 3.
* Reformat nova/tests/unit/objects/test_instance_action.py and
nova/tests/unit/virt/hyperv/test_hypervapi.py to 80 columns
Blueprint nova-python3
Change-Id: I7ced236b6f8f8b6a5d2e7fee3c4f0ba4d72c21fb
Diffstat (limited to 'nova/api/openstack/wsgi.py')
-rw-r--r-- | nova/api/openstack/wsgi.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 04613aab61..8358ba933c 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -775,7 +775,7 @@ class Resource(wsgi.Application): if body: msg = _("Action: '%(action)s', calling method: %(meth)s, body: " "%(body)s") % {'action': action, - 'body': unicode(body, 'utf-8'), + 'body': six.text_type(body, 'utf-8'), 'meth': str(meth)} LOG.debug(strutils.mask_password(msg)) else: |