SHA256
1
0
forked from pool/salt
salt/add-astra-linux-common-edition-to-the-os-family-list.patch

60 lines
2.0 KiB
Diff

From 30366101c20eefd2411482138edfa0ca0c8a3b06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julio=20Gonz=C3=A1lez=20Gil?=
<juliogonzalez@users.noreply.github.com>
Date: Wed, 12 Feb 2020 10:05:45 +0100
Subject: [PATCH] Add Astra Linux Common Edition to the OS Family list
(#209)
---
salt/grains/core.py | 1 +
tests/unit/grains/test_core.py | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/salt/grains/core.py b/salt/grains/core.py
index e007f40c92..19937f008e 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -1636,6 +1636,7 @@ _OS_FAMILY_MAP = {
"AIX": "AIX",
"TurnKey": "Debian",
"Pop": "Debian",
+ "AstraLinuxCE": "Debian",
}
# Matches any possible format:
diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py
index 7173f04979..e8845e2dfa 100644
--- a/tests/unit/grains/test_core.py
+++ b/tests/unit/grains/test_core.py
@@ -826,6 +826,26 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
}
self._run_os_grains_tests("pop-20.10", _os_release_map, expectation)
+ @skipIf(not salt.utils.platform.is_linux(), "System is not Linux")
+ def test_astralinuxce_2_os_grains(self):
+ """
+ Test if OS grains are parsed correctly in Astra Linux CE 2.12.22 "orel"
+ """
+ _os_release_map = {
+ "_linux_distribution": ("AstraLinuxCE", "2.12.22", "orel"),
+ }
+ expectation = {
+ "os": "AstraLinuxCE",
+ "os_family": "Debian",
+ "oscodename": "orel",
+ "osfullname": "AstraLinuxCE",
+ "osrelease": "2.12.22",
+ "osrelease_info": (2, 12, 22),
+ "osmajorrelease": 2,
+ "osfinger": "AstraLinuxCE-2",
+ }
+ self._run_os_grains_tests("astralinuxce-2.12.22", _os_release_map, expectation)
+
@skipIf(not salt.utils.platform.is_windows(), "System is not Windows")
def test_windows_platform_data(self):
"""
--
2.33.0