Просмотр исходного кода

Choose CentOS morphing tool when migrating Alma Linux

Daniel Vincze 6 месяцев назад
Родитель
Сommit
1a2b1d0c2d
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      coriolis/osmorphing/osdetect/centos.py

+ 5 - 3
coriolis/osmorphing/osdetect/centos.py

@@ -11,6 +11,7 @@ from oslo_log import log as logging
 LOG = logging.getLogger(__name__)
 CENTOS_DISTRO_IDENTIFIER = "CentOS"
 CENTOS_STREAM_DISTRO_IDENTIFIER = "CentOS Stream"
+ALMA_IDENTIFIER = "AlmaLinux"
 
 
 class CentOSOSDetectTools(base.BaseLinuxOSDetectTools):
@@ -26,10 +27,11 @@ class CentOSOSDetectTools(base.BaseLinuxOSDetectTools):
                              release_info[0].strip())
                 if m:
                     distro, version, _, _ = m.groups()
-                    if CENTOS_DISTRO_IDENTIFIER not in distro:
+                    if (CENTOS_DISTRO_IDENTIFIER not in distro and
+                            ALMA_IDENTIFIER not in distro):
                         LOG.debug(
-                            "Distro does not appear to be a CentOS: %s",
-                            distro)
+                            "Distro does not appear to be a CentOS or Alma: "
+                            f"{distro}")
                         return {}
 
                     distribution_name = CENTOS_DISTRO_IDENTIFIER