From 62aa713a1b7b99760a0a24fcc9bb48ef8137e5bd Mon Sep 17 00:00:00 2001 From: chenying Date: Thu, 10 Sep 2015 11:04:23 +0800 Subject: [PATCH] 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 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 --- cinderclient/v2/volume_backups.py | 1 - cinderclient/v2/volume_snapshots.py | 1 - cinderclient/v2/volume_transfers.py | 1 - 3 files changed, 3 deletions(-) diff --git a/cinderclient/v2/volume_backups.py b/cinderclient/v2/volume_backups.py index 70fda6066..2a7a605a7 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 "" % self.id diff --git a/cinderclient/v2/volume_snapshots.py b/cinderclient/v2/volume_snapshots.py index 21ce24510..2c24ac1fe 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 "" % self.id diff --git a/cinderclient/v2/volume_transfers.py b/cinderclient/v2/volume_transfers.py index a562c1500..633f2ac3d 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 "" % self.id