Merge "Remove a redundant wait_for_backup_deletion()"
This commit is contained in:
commit
1a8c2d4aa5
@ -43,7 +43,7 @@ class VolumesBackupsAdminV2Test(base.BaseVolumeAdminTest):
|
||||
|
||||
def _delete_backup(self, backup_id):
|
||||
self.admin_backups_client.delete_backup(backup_id)
|
||||
self.admin_backups_client.wait_for_backup_deletion(backup_id)
|
||||
self.admin_backups_client.wait_for_resource_deletion(backup_id)
|
||||
|
||||
def _decode_url(self, backup_url):
|
||||
return json.loads(base64.decodestring(backup_url))
|
||||
|
@ -116,14 +116,9 @@ class BaseBackupsClient(rest_client.RestClient):
|
||||
self.build_timeout))
|
||||
raise exceptions.TimeoutException(message)
|
||||
|
||||
def wait_for_backup_deletion(self, backup_id):
|
||||
"""Waits for backup deletion"""
|
||||
start_time = int(time.time())
|
||||
while True:
|
||||
try:
|
||||
self.show_backup(backup_id)
|
||||
except lib_exc.NotFound:
|
||||
return
|
||||
if int(time.time()) - start_time >= self.build_timeout:
|
||||
raise exceptions.TimeoutException
|
||||
time.sleep(self.build_interval)
|
||||
def is_resource_deleted(self, id):
|
||||
try:
|
||||
self.show_backup(id)
|
||||
except lib_exc.NotFound:
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user