]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix method VolumeTypeList.get_all
authorDmitry Guryanov <dguryanov@parallels.com>
Tue, 13 Oct 2015 11:53:13 +0000 (14:53 +0300)
committerJohn Griffith <john.griffith8@gmail.com>
Tue, 13 Oct 2015 18:25:47 +0000 (18:25 +0000)
commit35579d812500890518215f4a766412ceb880d078
tree9a1773dc615bbed994e40bc15b8d2cf67b4db5cc
parent7fb767f2d652f070a20fd70d92585d61e56f3a50
Fix method VolumeTypeList.get_all

Function volume_types.get_all_types returns dict, then
VolumeTypeList.get_all passes it to base.obj_make_list, which, in turn,
passes it to oslo_versionedobjects.base.obj_make_list.

And this function iterates over 4th argument and calls
item_cls._from_db_object for each item. So if it will iterate over dict
from volume_types.get_all_types, it'll get strings instead of orm
objects.

By the way, VolumeTypeList.get_all is not used anywhere in cinder code.
I tried to use it in unit test for my new patch and found this problem.

Closes-Bug: #1505653

Change-Id: If789bc5bf224974de5c4e4b9a57c83ef51d1779b
cinder/objects/volume_type.py
cinder/tests/unit/objects/test_volume_type.py