Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EndeavourOS os_family #62220

Merged
merged 3 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/62220.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added EndeavourOS to the Arch os_family.
1 change: 1 addition & 0 deletions salt/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,7 @@ def _derive_os_grain(osfullname):
"Arch ARM": "Arch",
"Manjaro": "Arch",
"Antergos": "Arch",
"EndeavourOS": "Arch",
"ALT": "RedHat",
"Trisquel": "Debian",
"GCEL": "Debian",
Expand Down
26 changes: 26 additions & 0 deletions tests/pytests/unit/grains/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,32 @@ def test_almalinux_8_os_grains(os_release_dir):
_run_os_grains_tests(os_release_dir, None, _os_release_map, expectation)


@pytest.mark.skip_unless_on_linux
def test_endeavouros_os_grains(os_release_dir):
"""
Test if OS grains are parsed correctly in EndeavourOS
"""
_os_release_map = {
"os_release_file": {
"NAME": "EndeavourOS",
"VERSION_ID": "22.9",
},
"_linux_distribution": ("EndeavourOS", "22.9", ""),
}

expectation = {
"os": "EndeavourOS",
"os_family": "Arch",
"oscodename": "",
"osfullname": "EndeavourOS",
"osrelease": "22.9",
"osrelease_info": (22, 9),
"osmajorrelease": 22,
"osfinger": "EndeavourOS-22",
}
_run_os_grains_tests(os_release_dir, None, _os_release_map, expectation)


def test_unicode_error():
raise_unicode_mock = MagicMock(name="raise_unicode_error", side_effect=UnicodeError)
with patch("salt.grains.core.hostname"), patch(
Expand Down