From 29fb7954ec180d2aa97d64a80b5a794da435f827 Mon Sep 17 00:00:00 2001 From: st-man <92167612+st-man@users.noreply.github.com> Date: Tue, 10 Feb 2026 22:42:29 +0300 Subject: [PATCH 1/7] grains: add missing os_family mappings Extend os_family mapping for additional Linux distributions. This aligns os_family detection with existing SUSE and RedHat families without affecting default behavior. --- salt/grains/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/salt/grains/core.py b/salt/grains/core.py index 992532689a35..bdd797ada934 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -1902,6 +1902,10 @@ def _derive_os_grain(osfullname, os_id=None): "openSUSE Leap": "Suse", "openSUSE Tumbleweed": "Suse", "SLES_SAP": "Suse", + "alfaLinux": "Suse", + "alfaLinux Rise": "Suse", + "AlterOS": "RedHat", + "RED OS": "RedHat", "Arch ARM": "Arch", "Manjaro": "Arch", "Manjaro ARM": "Arch", From dfa3c81917a5fc6f6aaaf3f2302d8ce05b5a1a3f Mon Sep 17 00:00:00 2001 From: st-man <92167612+st-man@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:57:58 +0300 Subject: [PATCH 2/7] Create 68715.added.md --- changelog/68715.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/68715.added.md diff --git a/changelog/68715.added.md b/changelog/68715.added.md new file mode 100644 index 000000000000..d3f02b5f5912 --- /dev/null +++ b/changelog/68715.added.md @@ -0,0 +1 @@ +Added os_family mappings for additional Linux distributions. From d363309ac02baf989e64fd3ae27584fb90463172 Mon Sep 17 00:00:00 2001 From: StMan Date: Wed, 11 Feb 2026 18:43:04 +0300 Subject: [PATCH 3/7] grains: map additional distro os_family --- tests/pytests/unit/grains/test_core.py | 82 ++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index 15ded063ecc1..26a4568c50ce 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -5608,3 +5608,85 @@ def test__ps(): "| awk '{ $7=\"\"; print }'" ) } +@pytest.mark.skip_unless_on_linux +def test_alfalinux_os_grains(): + _os_release_data = { + "NAME": "alfaLinux", + "PRETTY_NAME": "alfaLinux", + "ID": "alfalinux", + "VERSION_ID": "1", + } + expectation = { + "os": "alfaLinux", + "os_family": "Suse", + "osfullname": "alfaLinux", + "oscodename": "alfaLinux", + "osfinger": "alfaLinux-1", + "osrelease": "1", + "osrelease_info": (1,), + "osmajorrelease": 1, + } + _run_os_grains_tests(_os_release_data, {}, expectation) + + +@pytest.mark.skip_unless_on_linux +def test_alfalinux_rise_os_grains(): + _os_release_data = { + "NAME": "alfaLinux Rise", + "PRETTY_NAME": "alfaLinux Rise", + "ID": "alfalinux-rise", + "VERSION_ID": "1", + } + expectation = { + "os": "alfaLinux Rise", + "os_family": "Suse", + "osfullname": "alfaLinux Rise", + "oscodename": "alfaLinux Rise", + "osfinger": "alfaLinux Rise-1", + "osrelease": "1", + "osrelease_info": (1,), + "osmajorrelease": 1, + } + _run_os_grains_tests(_os_release_data, {}, expectation) + +@pytest.mark.skip_unless_on_linux +def test_alteros_os_grains(): + _os_release_data = { + "NAME": "AlterOS", + "PRETTY_NAME": "AlterOS", + "ID": "alteros", + "VERSION_ID": "1", + } + expectation = { + "os": "AlterOS", + "os_family": "RedHat", + "osfullname": "AlterOS", + "oscodename": "AlterOS", + "osfinger": "AlterOS-1", + "osrelease": "1", + "osrelease_info": (1,), + "osmajorrelease": 1, + } + _run_os_grains_tests(_os_release_data, {}, expectation) + + +@pytest.mark.skip_unless_on_linux +def test_red_os_os_grains(): + _os_release_data = { + "NAME": "RED OS", + "PRETTY_NAME": "RED OS", + "ID": "redos", + "VERSION_ID": "1", + } + expectation = { + "os": "RED OS", + "os_family": "RedHat", + "osfullname": "RED OS", + "oscodename": "RED OS", + "osfinger": "RED OS-1", + "osrelease": "1", + "osrelease_info": (1,), + "osmajorrelease": 1, + } + _run_os_grains_tests(_os_release_data, {}, expectation) + From 42cb7ef34b5b979e412c3ee6a85e1112d4c22116 Mon Sep 17 00:00:00 2001 From: StMan Date: Thu, 12 Feb 2026 21:53:19 +0300 Subject: [PATCH 4/7] Fix test formatting for pre-commit --- tests/pytests/unit/grains/test_core.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index 26a4568c50ce..ffe9dea32ccb 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -5608,7 +5608,8 @@ def test__ps(): "| awk '{ $7=\"\"; print }'" ) } -@pytest.mark.skip_unless_on_linux + + def test_alfalinux_os_grains(): _os_release_data = { "NAME": "alfaLinux", @@ -5629,7 +5630,6 @@ def test_alfalinux_os_grains(): _run_os_grains_tests(_os_release_data, {}, expectation) -@pytest.mark.skip_unless_on_linux def test_alfalinux_rise_os_grains(): _os_release_data = { "NAME": "alfaLinux Rise", @@ -5649,7 +5649,7 @@ def test_alfalinux_rise_os_grains(): } _run_os_grains_tests(_os_release_data, {}, expectation) -@pytest.mark.skip_unless_on_linux + def test_alteros_os_grains(): _os_release_data = { "NAME": "AlterOS", @@ -5670,7 +5670,6 @@ def test_alteros_os_grains(): _run_os_grains_tests(_os_release_data, {}, expectation) -@pytest.mark.skip_unless_on_linux def test_red_os_os_grains(): _os_release_data = { "NAME": "RED OS", From b40c95a2cea6a96e925be7958144bc8712f10af4 Mon Sep 17 00:00:00 2001 From: StMan Date: Fri, 13 Feb 2026 14:57:47 +0300 Subject: [PATCH 5/7] Fix test formatting again for pre-commit --- tests/pytests/unit/grains/test_core.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index ffe9dea32ccb..105a2c6aefa4 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -5610,6 +5610,7 @@ def test__ps(): } +@pytest.mark.skip_unless_on_linux def test_alfalinux_os_grains(): _os_release_data = { "NAME": "alfaLinux", @@ -5617,6 +5618,7 @@ def test_alfalinux_os_grains(): "ID": "alfalinux", "VERSION_ID": "1", } + expectation = { "os": "alfaLinux", "os_family": "Suse", @@ -5627,9 +5629,11 @@ def test_alfalinux_os_grains(): "osrelease_info": (1,), "osmajorrelease": 1, } + _run_os_grains_tests(_os_release_data, {}, expectation) +@pytest.mark.skip_unless_on_linux def test_alfalinux_rise_os_grains(): _os_release_data = { "NAME": "alfaLinux Rise", @@ -5637,6 +5641,7 @@ def test_alfalinux_rise_os_grains(): "ID": "alfalinux-rise", "VERSION_ID": "1", } + expectation = { "os": "alfaLinux Rise", "os_family": "Suse", @@ -5647,9 +5652,11 @@ def test_alfalinux_rise_os_grains(): "osrelease_info": (1,), "osmajorrelease": 1, } + _run_os_grains_tests(_os_release_data, {}, expectation) +@pytest.mark.skip_unless_on_linux def test_alteros_os_grains(): _os_release_data = { "NAME": "AlterOS", @@ -5657,6 +5664,7 @@ def test_alteros_os_grains(): "ID": "alteros", "VERSION_ID": "1", } + expectation = { "os": "AlterOS", "os_family": "RedHat", @@ -5667,9 +5675,11 @@ def test_alteros_os_grains(): "osrelease_info": (1,), "osmajorrelease": 1, } + _run_os_grains_tests(_os_release_data, {}, expectation) +@pytest.mark.skip_unless_on_linux def test_red_os_os_grains(): _os_release_data = { "NAME": "RED OS", @@ -5677,6 +5687,7 @@ def test_red_os_os_grains(): "ID": "redos", "VERSION_ID": "1", } + expectation = { "os": "RED OS", "os_family": "RedHat", @@ -5687,5 +5698,6 @@ def test_red_os_os_grains(): "osrelease_info": (1,), "osmajorrelease": 1, } + _run_os_grains_tests(_os_release_data, {}, expectation) From f78aacaa641d189fd8a5cfd30b2c89a902a524d0 Mon Sep 17 00:00:00 2001 From: StMan Date: Fri, 13 Feb 2026 22:12:30 +0300 Subject: [PATCH 6/7] Fix trailing newlines in test_core --- tests/pytests/unit/grains/test_core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index 105a2c6aefa4..17efa9a367f8 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -5700,4 +5700,3 @@ def test_red_os_os_grains(): } _run_os_grains_tests(_os_release_data, {}, expectation) - From ec8c79c99c6f91a99172b11c69b668527980c794 Mon Sep 17 00:00:00 2001 From: StMan Date: Sat, 14 Feb 2026 16:43:58 +0300 Subject: [PATCH 7/7] Another fix trailing newlines in test_core --- tests/pytests/unit/grains/test_core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index 17efa9a367f8..105a2c6aefa4 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -5700,3 +5700,4 @@ def test_red_os_os_grains(): } _run_os_grains_tests(_os_release_data, {}, expectation) +