Merge autopkgtest-cloud:better-cleanup into autopkgtest-cloud:master
Status: | Merged |
---|---|
Merged at revision: | 9f2dd7a6de71c70f9bc1493e0e33aaaba72f3e2e |
Proposed branch: | autopkgtest-cloud:better-cleanup |
Merge into: | autopkgtest-cloud:master |
Diff against target: |
87 lines (+36/-27) 1 file modified
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/cleanup-instances (+36/-27) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paride Legovini | Needs Information | ||
Ubuntu Release Team | Pending | ||
Review via email: mp+426655@code.launchpad.net |
Description of the change
When running cleanup-instances I ran into a python traceback:
Traceback (most recent call last):
File "autopkgtest-
instance.
File "/usr/lib/
return self.manager.
File "/usr/lib/
return self._delete(
File "/usr/lib/
resp, body = self.api.
File "/usr/lib/
return self.request(url, 'DELETE', **kwargs)
File "/usr/lib/
raise exceptions.
novaclient.
That instance appears in `nova list` but has a "Task state" of scheduling and a "Power state" of NOSTATE. I think the script should continue cleaning up the instances rather than crashing when it encounters an error.
Additionally, I've reorganized the order of operations so that we don't write to influx until after the instance has actually been deleted.
I also noticed that we don't log anything when deleting instances without associated autopkgtests so fixed that too.
An inline comment/question, but this basically LGTM.