Remove uses of unicode() builtin

Some uses of unicode() appear to have crept into glance's codebase. This
change replaces them with the recommended six.text_type().

Change-Id: I239f91114a921d3276da5cfd96ec1fde10601565
Partial-bug: #1282893
This commit is contained in:
Louis Taylor 2014-09-17 16:18:49 +00:00
parent b68c647168
commit b31d7a4c7a
2 changed files with 3 additions and 3 deletions

View File

@ -210,9 +210,9 @@ def image_meta_to_http_headers(image_meta):
for pk, pv in v.items():
if pv is not None:
headers["x-image-meta-property-%s"
% pk.lower()] = unicode(pv)
% pk.lower()] = six.text_type(pv)
else:
headers["x-image-meta-%s" % k.lower()] = unicode(v)
headers["x-image-meta-%s" % k.lower()] = six.text_type(v)
return headers

View File

@ -138,7 +138,7 @@ class ScrubFileQueue(ScrubQueue):
while True:
loc_id = f.readline().strip()
if loc_id:
lid = unicode(loc_id)
lid = six.text_type(loc_id)
loc_ids.append(int(lid) if lid.isdigit() else lid)
uris.append(unicode(f.readline().strip()))
delete_times.append(int(f.readline().strip()))