]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
maas: add hack to search for centos stream image wip-dmick-maas
authorDan Mick <dan.mick@redhat.com>
Fri, 12 Dec 2025 21:20:33 +0000 (13:20 -0800)
committerDan Mick <dan.mick@redhat.com>
Sat, 13 Dec 2025 02:25:07 +0000 (18:25 -0800)
fog does this too.  It's gross.

Signed-off-by: Dan Mick <dan.mick@redhat.com>
teuthology/orchestra/opsys.py
teuthology/provision/maas.py

index 614ec9f25d1e69c1ad80bb792ce4e9f232997c14..1c0ad86caaf74dd74b9c93c63c9c409d2a4bd886 100644 (file)
@@ -46,7 +46,9 @@ DISTRO_CODENAME_MAP = {
     },
     "centos": {
         "10": "stream",
+        "centos10-stream": "stream",
         "9": "stream",
+        "centos9-stream": "stream",
         "8": "core",
         "7": "core",
         "6": "core",
index 3dfdffa13c5c1d945d6465f8a2479c26f8ac71e6..c675e9ee452a52522545fdc8f5deca0ada35d53f 100644 (file)
@@ -213,6 +213,18 @@ class MAAS(object):
             major_machine_arch = self.arch.split('/')[0]
             if image["name"] == name and major_image_arch == major_machine_arch:
                 return image
+        # hack: look for stream.  This is the same as fog, but there
+        # really should be a better way
+        if self.os_type == 'centos':
+            # self.os_version is '<n>.stream'.
+            os_version = self.os_version.split('.')[0]
+            name = f'centos/centos{os_version}-stream'
+            for image in resp:
+                major_image_arch = image["architecture"].split('/')[0]
+                major_machine_arch = self.arch.split('/')[0]
+                if image["name"] == name and major_image_arch == major_machine_arch:
+                    return image
+
         raise RuntimeError(f"MaaS has no {name} image for {major_machine_arch}. Available images: {self.suggest_image_names()}")
 
     def suggest_image_names(self):