2021-01-08 13:41:50 +01:00
|
|
|
From d5569023c64a3fcec57a7aa6823ee94e8be91b3d Mon Sep 17 00:00:00 2001
|
2020-03-05 13:49:45 +01:00
|
|
|
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
|
2021-01-08 13:41:50 +01:00
|
|
|
index 5dff6ecfd4..5634327623 100644
|
2020-03-05 13:49:45 +01:00
|
|
|
--- a/salt/grains/core.py
|
|
|
|
+++ b/salt/grains/core.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -1618,6 +1618,7 @@ _OS_FAMILY_MAP = {
|
|
|
|
"Funtoo": "Gentoo",
|
|
|
|
"AIX": "AIX",
|
|
|
|
"TurnKey": "Debian",
|
|
|
|
+ "AstraLinuxCE": "Debian",
|
2020-03-05 13:49:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Matches any possible format:
|
|
|
|
diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index 85d434dd9d..196dbcf83d 100644
|
2020-03-05 13:49:45 +01:00
|
|
|
--- a/tests/unit/grains/test_core.py
|
|
|
|
+++ b/tests/unit/grains/test_core.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -728,6 +728,26 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
|
2020-03-05 13:49:45 +01:00
|
|
|
}
|
|
|
|
self._run_os_grains_tests("ubuntu-17.10", _os_release_map, expectation)
|
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
+ @skipIf(not salt.utils.platform.is_linux(), "System is not Linux")
|
2020-03-05 13:49:45 +01:00
|
|
|
+ def test_astralinuxce_2_os_grains(self):
|
2021-01-08 13:41:50 +01:00
|
|
|
+ """
|
2020-03-05 13:49:45 +01:00
|
|
|
+ Test if OS grains are parsed correctly in Astra Linux CE 2.12.22 "orel"
|
2021-01-08 13:41:50 +01:00
|
|
|
+ """
|
2020-03-05 13:49:45 +01:00
|
|
|
+ _os_release_map = {
|
2021-01-08 13:41:50 +01:00
|
|
|
+ "linux_distribution": ("AstraLinuxCE", "2.12.22", "orel"),
|
2020-03-05 13:49:45 +01:00
|
|
|
+ }
|
|
|
|
+ expectation = {
|
2021-01-08 13:41:50 +01:00
|
|
|
+ "os": "AstraLinuxCE",
|
|
|
|
+ "os_family": "Debian",
|
|
|
|
+ "oscodename": "orel",
|
|
|
|
+ "osfullname": "AstraLinuxCE",
|
|
|
|
+ "osrelease": "2.12.22",
|
|
|
|
+ "osrelease_info": (2, 12, 22),
|
|
|
|
+ "osmajorrelease": 2,
|
|
|
|
+ "osfinger": "AstraLinuxCE-2",
|
2020-03-05 13:49:45 +01:00
|
|
|
+ }
|
|
|
|
+ self._run_os_grains_tests("astralinuxce-2.12.22", _os_release_map, expectation)
|
|
|
|
+
|
2021-01-08 13:41:50 +01:00
|
|
|
@skipIf(not salt.utils.platform.is_windows(), "System is not Windows")
|
2020-03-05 13:49:45 +01:00
|
|
|
def test_windows_platform_data(self):
|
2021-01-08 13:41:50 +01:00
|
|
|
"""
|
2020-03-05 13:49:45 +01:00
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2020-03-05 13:49:45 +01:00
|
|
|
|
|
|
|
|