]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Sort snapshots in create CG from CG snapshot
authorXing Yang <xing.yang@emc.com>
Wed, 11 Mar 2015 04:42:16 +0000 (00:42 -0400)
committerXing Yang <xing.yang@emc.com>
Wed, 11 Mar 2015 17:09:10 +0000 (13:09 -0400)
commit56c47cc5f51bc94d1df382cd6f4255acd7048808
tree439ba0a63fd4065badf66008138ab2ac93589694
parent2f701a39208f9396893cd8a57165e37cfeb6fc2f
Sort snapshots in create CG from CG snapshot

This problem was discovered while testing create CG from CG snapshot.
In create_consistencygroup_from_src() in manager.py, it calls the driver
method create_consistencygroup_from_src() and passes in parameters
including source snapshots and target volumes. The problem is that the
snapshots list is not sorted to be in the same order as their corresponding
volumes. So they may be in the wrong order.

In this patch, the source snapshots were sorted before being passed to
the driver.

Change-Id: I988ce2836f2d553391deeee6e68738356877109b
Closes-Bug: #1430628
cinder/tests/test_volume.py
cinder/volume/manager.py