2021-09-27 12:08:32 +02:00
|
|
|
From e3e55336b0d457cb55cd83236e9ac8e0dc671d2e Mon Sep 17 00:00:00 2001
|
2021-09-16 09:59:31 +02:00
|
|
|
From: Victor Zhestkov <35733135+vzhestkov@users.noreply.github.com>
|
|
|
|
Date: Mon, 5 Jul 2021 18:57:26 +0300
|
|
|
|
Subject: [PATCH] Adding preliminary support for Rocky. (#59682) (#391)
|
|
|
|
|
|
|
|
* Adding preliminary support for Rocky.
|
|
|
|
|
|
|
|
* Adding changelog and test per MR guidence.
|
|
|
|
|
|
|
|
* Update test_core.py
|
|
|
|
|
|
|
|
Fix a clean up issue
|
|
|
|
|
|
|
|
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
|
|
|
|
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
|
|
|
|
|
|
|
|
Co-authored-by: StackKorora <42156355+StackKorora@users.noreply.github.com>
|
|
|
|
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
|
|
|
|
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
|
|
|
|
---
|
|
|
|
changelog/59682.added | 1 +
|
|
|
|
salt/grains/core.py | 2 ++
|
|
|
|
tests/unit/grains/test_core.py | 29 +++++++++++++++++++++++++++++
|
|
|
|
3 files changed, 32 insertions(+)
|
|
|
|
create mode 100644 changelog/59682.added
|
|
|
|
|
|
|
|
diff --git a/changelog/59682.added b/changelog/59682.added
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000..93b4a3d1fc
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/changelog/59682.added
|
|
|
|
@@ -0,0 +1 @@
|
|
|
|
+Rocky Linux has been added to the RedHat os_family.
|
|
|
|
diff --git a/salt/grains/core.py b/salt/grains/core.py
|
2021-09-27 12:08:32 +02:00
|
|
|
index bce8c95179..f79110124f 100644
|
2021-09-16 09:59:31 +02:00
|
|
|
--- a/salt/grains/core.py
|
|
|
|
+++ b/salt/grains/core.py
|
2021-09-27 12:08:32 +02:00
|
|
|
@@ -1560,6 +1560,7 @@ _OS_NAME_MAP = {
|
2021-09-16 09:59:31 +02:00
|
|
|
"linuxmint": "Mint",
|
|
|
|
"neon": "KDE neon",
|
2021-09-27 12:08:32 +02:00
|
|
|
"pop": "Pop",
|
2021-09-16 09:59:31 +02:00
|
|
|
+ "rocky": "Rocky",
|
|
|
|
"alibabaclo": "Alinux",
|
|
|
|
}
|
|
|
|
|
2021-09-27 12:08:32 +02:00
|
|
|
@@ -1637,6 +1638,7 @@ _OS_FAMILY_MAP = {
|
2021-09-16 09:59:31 +02:00
|
|
|
"AIX": "AIX",
|
|
|
|
"TurnKey": "Debian",
|
2021-09-27 12:08:32 +02:00
|
|
|
"Pop": "Debian",
|
2021-09-16 09:59:31 +02:00
|
|
|
+ "Rocky": "RedHat",
|
|
|
|
"AstraLinuxCE": "Debian",
|
|
|
|
"Alinux": "RedHat",
|
|
|
|
}
|
|
|
|
diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py
|
2021-09-27 12:08:32 +02:00
|
|
|
index fa06bb27ab..fcc7586775 100644
|
2021-09-16 09:59:31 +02:00
|
|
|
--- a/tests/unit/grains/test_core.py
|
|
|
|
+++ b/tests/unit/grains/test_core.py
|
2021-09-27 12:08:32 +02:00
|
|
|
@@ -708,6 +708,35 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
2021-09-16 09:59:31 +02:00
|
|
|
}
|
|
|
|
self._run_os_grains_tests(None, _os_release_map, expectation)
|
|
|
|
|
|
|
|
+ @skipIf(not salt.utils.platform.is_linux(), "System is not Linux")
|
|
|
|
+ def test_rocky_8_os_grains(self):
|
|
|
|
+ """
|
|
|
|
+ Test if OS grains are parsed correctly in Rocky 8
|
|
|
|
+ """
|
|
|
|
+ _os_release_map = {
|
|
|
|
+ "os_release_file": {
|
|
|
|
+ "NAME": "Rocky",
|
|
|
|
+ "VERSION_ID": "8.3",
|
|
|
|
+ "PRETTY_NAME": "Rocky 8",
|
|
|
|
+ "ID": "Rocky",
|
|
|
|
+ "ANSI_COLOR": "0;31",
|
|
|
|
+ "CPE_NAME": "cpe:/o:rocky:rocky:8.3",
|
|
|
|
+ },
|
|
|
|
+ "_linux_distribution": ("rocky", "8.3", ""),
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ expectation = {
|
|
|
|
+ "os": "Rocky",
|
|
|
|
+ "os_family": "RedHat",
|
|
|
|
+ "oscodename": "Rocky 8",
|
|
|
|
+ "osfullname": "Rocky",
|
|
|
|
+ "osrelease": "8.3",
|
|
|
|
+ "osrelease_info": (8, 3,),
|
|
|
|
+ "osmajorrelease": 8,
|
|
|
|
+ "osfinger": "Rocky-8",
|
|
|
|
+ }
|
|
|
|
+ self._run_os_grains_tests(None, _os_release_map, expectation)
|
|
|
|
+
|
|
|
|
@skipIf(not salt.utils.platform.is_linux(), "System is not Linux")
|
|
|
|
def test_almalinux_8_os_grains(self):
|
|
|
|
"""
|
|
|
|
--
|
2021-09-27 12:08:32 +02:00
|
|
|
2.33.0
|
2021-09-16 09:59:31 +02:00
|
|
|
|
|
|
|
|