copr: backend: better log IBM Cloud instance removals
This commit is contained in:
parent
b97e20c3d8
commit
9ddbd9773d
1 changed files with 8 additions and 5 deletions
|
@ -218,6 +218,7 @@ def delete_instance(service, instance_name, opts):
|
|||
delete_instance_attempt(service, instance_name, opts)
|
||||
break
|
||||
except:
|
||||
opts.log.exception("Attempt to delete instance failed")
|
||||
pass
|
||||
|
||||
|
||||
|
@ -240,12 +241,14 @@ def delete_instance_attempt(service, instance_name, opts):
|
|||
floating_ip_id = floating_ip["id"]
|
||||
|
||||
if delete_instance_id:
|
||||
service.delete_instance(delete_instance_id)
|
||||
if floating_ip_id:
|
||||
service.delete_floating_ip(floating_ip_id)
|
||||
resp = service.delete_instance(delete_instance_id)
|
||||
assert resp.status_code == 204
|
||||
log.debug("Delete instance request delivered")
|
||||
|
||||
# enforce re-try
|
||||
assert delete_instance_id and floating_ip_id
|
||||
if floating_ip_id:
|
||||
resp = service.delete_floating_ip(floating_ip_id)
|
||||
assert resp.status_code == 204
|
||||
log.debug("Delete IP request delivered")
|
||||
|
||||
|
||||
def _get_arg_parser():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue