Comment 2 for bug 2067628

Revision history for this message
Skia (hyask) wrote :

About 2., and the `instance.delete(wait=True)` idea, I've dug a bit in the code of the openstack clients, and I've found that:
* The `--wait` option of the `openstack server delete` command is implemented here: https://opendev.org/openstack/python-openstackclient/src/commit/dd6ac285d5b35f87947f9c00f5558b55e9787747/openstackclient/compute/v2/server.py#L2135
* This calls the `wait_for_delete` function defined here: https://opendev.org/openstack/osc-lib/src/commit/f9bcdecf1abd0c38fd60cfd7d99a00b113bd6d57/osc_lib/utils/__init__.py#L661
* This is a simple polling loop, there's nothing more.
* I need to run some experiments, but it looks doable to make that same call to `wait_for_delete` in the worker code.
* In a second time, maybe this is something that could be implemented somehow directly in `novaclient` here: https://opendev.org/openstack/python-novaclient/src/commit/2bd135c13793da48af5fbad5208b00aaba7e39dc/novaclient/v2/servers.py#L66, to add that convenient `wait=True` parameter, but this would first require opening a bug somewhere to discuss this with the maintainers.