]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Make relationships in objects consistent
authorMichał Dulko <michal.dulko@intel.com>
Thu, 22 Oct 2015 12:54:35 +0000 (14:54 +0200)
committerMichał Dulko <michal.dulko@intel.com>
Thu, 22 Oct 2015 12:54:35 +0000 (14:54 +0200)
commit288ca5d8d6384926c2c3b2cb84b02be843846d2d
treeb6c6cbdd1aaa82f787402650f47d72a2c6df0224
parent944763920decc06f324d54db28e056485cc26507
Make relationships in objects consistent

In Volume object 1:n relationship on volume_attachment was modeled
by ListOfObjectsField. Moreover _from_db_object and obj_load_attr
actually were setting VolumeAttachmentList as value of that field,
which is wrong behavior.

In CGSnapshot similar relationship on snapshots was done by ObjectField
with SnapshotList inside.

This commit unifies the approach to use the latter. Also unit test is
added to prevent mismatch of field type and value set on it.

Change-Id: I802fc8807d7d4c42680bb19866c3e90c866d3f26
Closes-Bug: 1508889
cinder/objects/volume.py
cinder/tests/unit/objects/test_volume.py