copr-be: ibm cloud - attempt to remove all volumes
Even though it will fail most of the time. We keep cycling in the `cmd_list` termination loop all the time only because some of those volumes are some inconsistent state. It is just pity to not re-deliver the removal request (it could work, who knows).
This commit is contained in:
parent
aa3b617c74
commit
a0fa1ce1d6
1 changed files with 3 additions and 8 deletions
|
@ -263,20 +263,15 @@ def delete_instance_attempt(service, instance_name, opts):
|
|||
|
||||
log.debug("Found volume %s %s %s", volume["name"], volume["status"],
|
||||
volume["id"])
|
||||
|
||||
# Otherwise Error: Delete volume failed. Volume can be deleted
|
||||
# only when its status is available or failed., Code: 409
|
||||
if not volume["status"] in ["available", "failed"]:
|
||||
continue
|
||||
|
||||
volume_ids.append(volume["id"])
|
||||
|
||||
if volume_ids:
|
||||
for volume_id in volume_ids:
|
||||
log.info("Deleting volume %s", volume_id)
|
||||
resp = service.delete_volume(volume_id)
|
||||
assert resp.status_code == 204
|
||||
log.debug("Delete volume request delivered")
|
||||
if resp.status_code != 204:
|
||||
log.error("Can't delete volume %s, response status: %s",
|
||||
volume_id, resp.status_code)
|
||||
|
||||
|
||||
def _get_arg_parser():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue