type() method should be replaced with isinstance() in stone/__init__.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Wishlist
|
wanghong |
Bug Description
In store/__init__.py, there is two places use the "type" method to determine the type. It's bertter to use the "isinstance" method instead.
The code is:
def check_location_
t = type(val)
if t == dict:
for key in val:
elif t == list:
ndx = 0
for v in val:
ndx = ndx + 1
elif t != unicode:
raise BackendExceptio
def store_add_
(location, size, checksum, metadata) = store.add(image_id, data, size)
if metadata is not None:
if type(metadata) != dict:
msg = (_("The storage driver %s returned invalid metadata %s"
raise BackendExceptio
Changed in glance: | |
assignee: | nobody → wanghong (w-wanghong) |
Changed in glance: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
Changed in glance: | |
milestone: | none → icehouse-2 |
status: | Fix Committed → Fix Released |
Changed in glance: | |
milestone: | icehouse-2 → 2014.1 |
Fix proposed to branch: master /review. openstack. org/65611
Review: https:/