Merge "Revert "cinder backup force-delete when backup is error""
This commit is contained in:
commit
6d95417bed
@ -1,9 +0,0 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
As in the [doc]:
|
||||
https://developer.openstack.org/api-ref/block-storage/v3/
|
||||
#force-delete-a-backup.
|
||||
|
||||
* Force-deletes a backup(v2)
|
||||
|
@ -121,7 +121,7 @@ class VolumesBackupsAdminTest(base.BaseVolumeAdminTest):
|
||||
'available')
|
||||
|
||||
@decorators.idempotent_id('47a35425-a891-4e13-961c-c45deea21e94')
|
||||
def test_volume_backup_reset_status_force_delete(self):
|
||||
def test_volume_backup_reset_status(self):
|
||||
# Create a volume
|
||||
volume = self.create_volume()
|
||||
# Create a backup
|
||||
@ -136,6 +136,3 @@ class VolumesBackupsAdminTest(base.BaseVolumeAdminTest):
|
||||
status="error")
|
||||
waiters.wait_for_volume_resource_status(self.admin_backups_client,
|
||||
backup['id'], 'error')
|
||||
# Force delete a backup volume when backup is in error state.
|
||||
self.admin_backups_client.force_delete_backup(backup['id'])
|
||||
self.admin_backups_client.wait_for_resource_deletion(backup['id'])
|
||||
|
@ -144,8 +144,7 @@ class BaseVolumeTest(api_version_utils.BaseMicroversionTest,
|
||||
snapshot['id'], 'available')
|
||||
return snapshot
|
||||
|
||||
def create_backup(self, volume_id, backup_client=None,
|
||||
wait_until="available", **kwargs):
|
||||
def create_backup(self, volume_id, backup_client=None, **kwargs):
|
||||
"""Wrapper utility that returns a test backup."""
|
||||
if backup_client is None:
|
||||
backup_client = self.backups_client
|
||||
@ -155,12 +154,9 @@ class BaseVolumeTest(api_version_utils.BaseMicroversionTest,
|
||||
|
||||
backup = backup_client.create_backup(
|
||||
volume_id=volume_id, **kwargs)['backup']
|
||||
|
||||
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
|
||||
backup_client.delete_backup, backup['id'])
|
||||
waiters.wait_for_volume_resource_status(backup_client,
|
||||
backup['id'],
|
||||
wait_until)
|
||||
self.addCleanup(backup_client.delete_backup, backup['id'])
|
||||
waiters.wait_for_volume_resource_status(backup_client, backup['id'],
|
||||
'available')
|
||||
return backup
|
||||
|
||||
# NOTE(afazekas): these create_* and clean_* could be defined
|
||||
|
@ -55,14 +55,6 @@ class BackupsClient(rest_client.RestClient):
|
||||
self.expected_success(202, resp.status)
|
||||
return rest_client.ResponseBody(resp, body)
|
||||
|
||||
def force_delete_backup(self, backup_id):
|
||||
"""Force delete a backup volume."""
|
||||
post_body = json.dumps({'os-force_delete': {}})
|
||||
url = 'backups/%s/action' % backup_id
|
||||
resp, body = self.post(url, post_body)
|
||||
self.expected_success(202, resp.status)
|
||||
return rest_client.ResponseBody(resp)
|
||||
|
||||
def show_backup(self, backup_id):
|
||||
"""Returns the details of a single backup."""
|
||||
url = "backups/%s" % backup_id
|
||||
|
Loading…
Reference in New Issue
Block a user