]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
maas: handle nodes with unexpected status 2129/head
authorZack Cerza <zack@cerza.org>
Thu, 15 Jan 2026 01:04:58 +0000 (18:04 -0700)
committerZack Cerza <zack@cerza.org>
Thu, 15 Jan 2026 01:38:55 +0000 (18:38 -0700)
Often times, we just need to release and re-allocate before provisioning.

Signed-off-by: Zack Cerza <zack@cerza.org>
teuthology/provision/maas.py

index b477d272f51b15f0b71643f56cd6e0fdf132060d..5d30510421b4e96061106f2f2b395cf84d47f30c 100644 (file)
@@ -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}'"
             )