Fix three resources not being deleted by using name
There are three resources: VolumeBackup, Snapshot, VolumeTransfer. None of them can be deleted by using their names on V2. For example, Snapshot client side filtering fails in the function findall. The reason is that snapshot object <class 'cinderclient.v2.volume_snapshots.Snapshot'> does not have a attribute 'display_name'. The response of /v2/{tenant_id}/backups/detail does not have a parameter 'display_name', but have a parameter 'name'. So class Snapshot does not need to define NAME_ATTR = 'display_name'. The superclass of Snapshot 'Resource' has defined NAME_ATTR = 'name'. Closes-Bug: #1497873 Closes-Bug: #1495428 Change-Id: I3c89fd9a82918e8a02385cfccb32dc9c3f4c4095
This commit is contained in:
@@ -22,7 +22,6 @@ from cinderclient import base
|
|||||||
|
|
||||||
class VolumeBackup(base.Resource):
|
class VolumeBackup(base.Resource):
|
||||||
"""A volume backup is a block level backup of a volume."""
|
"""A volume backup is a block level backup of a volume."""
|
||||||
NAME_ATTR = "display_name"
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<VolumeBackup: %s>" % self.id
|
return "<VolumeBackup: %s>" % self.id
|
||||||
|
@@ -26,7 +26,6 @@ from cinderclient import base
|
|||||||
|
|
||||||
class Snapshot(base.Resource):
|
class Snapshot(base.Resource):
|
||||||
"""A Snapshot is a point-in-time snapshot of an openstack volume."""
|
"""A Snapshot is a point-in-time snapshot of an openstack volume."""
|
||||||
NAME_ATTR = "display_name"
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<Snapshot: %s>" % self.id
|
return "<Snapshot: %s>" % self.id
|
||||||
|
@@ -27,7 +27,6 @@ from cinderclient import base
|
|||||||
|
|
||||||
class VolumeTransfer(base.Resource):
|
class VolumeTransfer(base.Resource):
|
||||||
"""Transfer a volume from one tenant to another"""
|
"""Transfer a volume from one tenant to another"""
|
||||||
NAME_ATTR = "display_name"
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<VolumeTransfer: %s>" % self.id
|
return "<VolumeTransfer: %s>" % self.id
|
||||||
|
Reference in New Issue
Block a user