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:
parent
b68c647168
commit
b31d7a4c7a
@ -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
|
||||
|
||||
|
||||
|
@ -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()))
|
||||
|
Loading…
Reference in New Issue
Block a user