]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Allow CG without snapshot to be deleted
authorXing Yang <xing.yang@emc.com>
Mon, 10 Aug 2015 21:15:50 +0000 (17:15 -0400)
committerXing Yang <xing.yang@emc.com>
Sat, 15 Aug 2015 08:31:40 +0000 (04:31 -0400)
commit62a682d20b6c7dc0556b1890ee29394edd00fea2
treec75c3d65b9649ef60e0a71f7674fdee67e75f0c7
parent3b40049cc858fa40ce99f2dba25d6a25f344a8e9
Allow CG without snapshot to be deleted

If a CG is created from CG Snapshot, it cannot be deleted until
the CG Snapshot is deleted. This is wrong. This is because the query
to find CG who are parents of CG Snapshot didn't filter out the
CG uuid and as a result, it is not possible to delete any CG if
there are any existing CG Snanpshot.

This patch fixes the problem by fixing the function in db API
that finds all CGs that have CG Snapshot depending on them.
* CGs with any CG Snapshot depending on them still cannot be deleted
  until the CG Snapshot is deleted first.
* CGs without any CG Snapshot depending on them should be allowed
  to be deleted.

Change-Id: I1380b26c4a957946c7dc27285557966f558cf03d
Closes-Bug: #1485783
cinder/db/sqlalchemy/api.py
cinder/tests/unit/test_db_api.py