Merge "Make generic group check work with admin table"

This commit is contained in:
Zuul 2018-08-15 15:46:28 +00:00 committed by Gerrit Code Review
commit 6122974512
2 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ class DeleteVolumeSnapshot(policy.PolicyTargetMixin, tables.DeleteAction):
def allowed(self, request, datum=None):
if datum:
# Can't delete snapshot if part of group snapshot
if datum.group_snapshot:
if getattr(datum, 'group_snapshot_id', None):
return False
return True

View File

@ -120,7 +120,7 @@ class DeleteVolume(VolumePolicyTargetMixin, tables.DeleteAction):
if getattr(volume, 'consistencygroup_id', None):
return False
# Can't delete volume if part of volume group
if volume.group:
if getattr(volume, 'group_id', None):
return False
return (volume.status in DELETABLE_STATES and
not getattr(volume, 'has_snapshot', False))