Merge "Make generic group check work with admin table"
This commit is contained in:
commit
6122974512
|
@ -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
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue