summaryrefslogtreecommitdiff
path: root/cinderclient
diff options
context:
space:
mode:
authorchenying <ying.chen@huawei.com>2015-09-10 11:04:23 +0800
committerchenying <ying.chen@huawei.com>2015-09-28 02:36:04 +0000
commit62aa713a1b7b99760a0a24fcc9bb48ef8137e5bd (patch)
treeb0cbdcbe7ab3a95e93aeab70e5283dac3abe703e /cinderclient
parent19ba5e8cf9e395dfccba47bb42c69f9a4dc7e26a (diff)
downloadpython-cinderclient-62aa713a1b7b99760a0a24fcc9bb48ef8137e5bd.tar.gz
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
Diffstat (limited to 'cinderclient')
-rw-r--r--cinderclient/v2/volume_backups.py1
-rw-r--r--cinderclient/v2/volume_snapshots.py1
-rw-r--r--cinderclient/v2/volume_transfers.py1
3 files changed, 0 insertions, 3 deletions
diff --git a/cinderclient/v2/volume_backups.py b/cinderclient/v2/volume_backups.py
index 70fda60..2a7a605 100644
--- a/cinderclient/v2/volume_backups.py
+++ b/cinderclient/v2/volume_backups.py
@@ -22,7 +22,6 @@ from cinderclient import base
class VolumeBackup(base.Resource):
"""A volume backup is a block level backup of a volume."""
- NAME_ATTR = "display_name"
def __repr__(self):
return "<VolumeBackup: %s>" % self.id
diff --git a/cinderclient/v2/volume_snapshots.py b/cinderclient/v2/volume_snapshots.py
index 21ce245..2c24ac1 100644
--- a/cinderclient/v2/volume_snapshots.py
+++ b/cinderclient/v2/volume_snapshots.py
@@ -26,7 +26,6 @@ from cinderclient import base
class Snapshot(base.Resource):
"""A Snapshot is a point-in-time snapshot of an openstack volume."""
- NAME_ATTR = "display_name"
def __repr__(self):
return "<Snapshot: %s>" % self.id
diff --git a/cinderclient/v2/volume_transfers.py b/cinderclient/v2/volume_transfers.py
index a562c15..633f2ac 100644
--- a/cinderclient/v2/volume_transfers.py
+++ b/cinderclient/v2/volume_transfers.py
@@ -27,7 +27,6 @@ from cinderclient import base
class VolumeTransfer(base.Resource):
"""Transfer a volume from one tenant to another"""
- NAME_ATTR = "display_name"
def __repr__(self):
return "<VolumeTransfer: %s>" % self.id