From 958d73ebc8c196dd30e9768d3e9cf1bdb6d32e25 Mon Sep 17 00:00:00 2001 From: Aleksandr Kravchenko Date: Thu, 1 Apr 2021 17:19:08 +0300 Subject: [PATCH 1/3] added AlmaLinux --- azurelinuxagent/common/osutil/factory.py | 2 +- azurelinuxagent/pa/rdma/factory.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azurelinuxagent/common/osutil/factory.py b/azurelinuxagent/common/osutil/factory.py index b212c38253..4a09544c4d 100644 --- a/azurelinuxagent/common/osutil/factory.py +++ b/azurelinuxagent/common/osutil/factory.py @@ -98,7 +98,7 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name) return DebianOSBaseUtil() - if distro_name in ("redhat", "rhel", "centos", "oracle"): + if distro_name in ("redhat", "rhel", "centos", "oracle", "almalinux"): if Version(distro_version) < Version("7"): return Redhat6xOSUtil() diff --git a/azurelinuxagent/pa/rdma/factory.py b/azurelinuxagent/pa/rdma/factory.py index d86d8b8f49..e19f2fe918 100644 --- a/azurelinuxagent/pa/rdma/factory.py +++ b/azurelinuxagent/pa/rdma/factory.py @@ -38,7 +38,7 @@ def get_rdma_handler( ): return SUSERDMAHandler() - if distro_full_name == 'CentOS Linux' or distro_full_name == 'CentOS' or distro_full_name == 'Red Hat Enterprise Linux Server': + if distro_full_name == 'CentOS Linux' or distro_full_name == 'CentOS' or distro_full_name == 'Red Hat Enterprise Linux Server' or distro_full_name == 'AlmaLinux': return CentOSRDMAHandler(distro_version) if distro_full_name == 'Ubuntu': diff --git a/setup.py b/setup.py index c258e4b878..8ebdde5e50 100755 --- a/setup.py +++ b/setup.py @@ -97,7 +97,7 @@ def get_data_files(name, version, fullname): # pylint: disable=R0912 agent_bin_path = osutil.get_agent_bin_path() set_bin_files(data_files, dest=agent_bin_path) - if name == 'redhat' or name == 'centos': # pylint: disable=R1714 + if name == 'redhat' or name == 'centos' or name == 'almalinux': # pylint: disable=R1714 set_conf_files(data_files) set_logrotate_files(data_files) set_udev_files(data_files) From 74e3b01b6be8014c4da92c30d8ac7464cb2d381e Mon Sep 17 00:00:00 2001 From: Aleksandr Kravchenko Date: Fri, 2 Apr 2021 16:06:56 +0300 Subject: [PATCH 2/3] added test for AlmaLinux --- tests/common/osutil/test_factory.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/common/osutil/test_factory.py b/tests/common/osutil/test_factory.py index f7d46b21a4..4ab234131b 100644 --- a/tests/common/osutil/test_factory.py +++ b/tests/common/osutil/test_factory.py @@ -237,6 +237,13 @@ def test_get_osutil_it_should_return_redhat(self): self.assertTrue(isinstance(ret, RedhatOSUtil)) self.assertEqual(ret.get_service_name(), "waagent") + ret = _get_osutil(distro_name="almalinux", + distro_code_name="", + distro_full_name="", + distro_version="8") + self.assertTrue(isinstance(ret, RedhatOSUtil)) + self.assertEqual(ret.get_service_name(), "waagent") + def test_get_osutil_it_should_return_euleros(self): ret = _get_osutil(distro_name="euleros", distro_code_name="", From c9eb420d4a6ce69d2c668deef273a446e73fe2d0 Mon Sep 17 00:00:00 2001 From: Aleksandr Kravchenko Date: Thu, 20 May 2021 13:48:17 +0300 Subject: [PATCH 3/3] improved --- azurelinuxagent/pa/rdma/factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurelinuxagent/pa/rdma/factory.py b/azurelinuxagent/pa/rdma/factory.py index e19f2fe918..c6d808117b 100644 --- a/azurelinuxagent/pa/rdma/factory.py +++ b/azurelinuxagent/pa/rdma/factory.py @@ -38,7 +38,7 @@ def get_rdma_handler( ): return SUSERDMAHandler() - if distro_full_name == 'CentOS Linux' or distro_full_name == 'CentOS' or distro_full_name == 'Red Hat Enterprise Linux Server' or distro_full_name == 'AlmaLinux': + if distro_full_name in ('CentOS Linux', 'CentOS', 'Red Hat Enterprise Linux Server', 'AlmaLinux'): return CentOSRDMAHandler(distro_version) if distro_full_name == 'Ubuntu':