evacuate: respect original SHUTOFF state in --wait completion · openstack/python-openstackclient@3909e93 · GitHub
Skip to content

Commit 3909e93

Browse files
committed
evacuate: respect original SHUTOFF state in --wait completion
When running `openstack server evacuate --wait`, the command would hang indefinitely if the instance was originally in SHUTOFF state, because only “ACTIVE” was treated as a successful completion. We now capture the server’s status before evacuation and dynamically include “SHUTOFF” in the `success_status` list if the instance was already shut off. This ensures that a shutoff instance is accepted as a valid completion without requiring manual intervention. Unit tests have been added and updated to cover both: - pre-evacuation ACTIVE → success_status=['active'] - pre-evacuation SHUTOFF → success_status=['active','shutoff'] Closes-Bug: #2103426 Change-Id: I86ad1cd173a144b16fde1dbac87819fab2d7a50a
1 parent a49a290 commit 3909e93

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

openstackclient/compute/v2/server.py

Lines changed: 6 additions & 0 deletions

openstackclient/tests/unit/compute/v2/test_server.py

Lines changed: 28 additions & 0 deletions

0 commit comments

Comments
 (0)