From 0d6e6fda7b2bd7aa1f75f10065531e4d0bb6ad45 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 14 Jan 2026 18:04:58 -0700 Subject: [PATCH] maas: handle nodes with unexpected status Often times, we just need to release and re-allocate before provisioning. Signed-off-by: Zack Cerza --- teuthology/provision/maas.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/teuthology/provision/maas.py b/teuthology/provision/maas.py index b477d272f..5d3051042 100644 --- a/teuthology/provision/maas.py +++ b/teuthology/provision/maas.py @@ -315,8 +315,10 @@ class MAAS(object): status_name = machine.get("status_name", "").lower() if status_name == "deployed": self.log.info(f"Machine '{self.shortname}' is already deployed; releasing") - self.release_machine() - + self.release() + elif status_name == "failed deployment": + self.log.info("Previous deployment failed; releasing before continuing") + self.release() elif status_name not in ["ready", "allocated"]: raise RuntimeError( f"MaaS machine '{self.shortname}' is not ready or allocated, " @@ -336,7 +338,6 @@ class MAAS(object): f"aborting deployment\n'{str(e)}'" ) self.abort_deploy() - self._wait_for_status("Ready") raise RuntimeError( f"Deployment of machine '{self.shortname}' failed" ) from e @@ -364,7 +365,7 @@ class MAAS(object): self.log.info(f"Unlocking machine '{self.shortname}' before release") self.unlock_machine() - else: + elif status_name != "failed deployment": raise RuntimeError( f"Cannot release machine '{self.shortname}' in status '{status_name}'" ) -- 2.47.3