From 75f8b74f70a7e0e9f25817ff87f2ed8fdcc4f11c Mon Sep 17 00:00:00 2001 From: Chad Phillips Date: Sun, 13 Sep 2020 09:23:57 -0700 Subject: [PATCH] Fix Pop!_OS 20.04 not using aptpkg Fixes #58395 --- changelog/58395.fixed | 1 + salt/grains/core.py | 2 ++ tests/unit/grains/test_core.py | 40 ++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 changelog/58395.fixed diff --git a/changelog/58395.fixed b/changelog/58395.fixed new file mode 100644 index 000000000000..7e9d49128534 --- /dev/null +++ b/changelog/58395.fixed @@ -0,0 +1 @@ +Pop!_OS 20.04 and 20.10 now support using pkg.* / aptpkg.* diff --git a/salt/grains/core.py b/salt/grains/core.py index 9d9f34f25fb8..9df622f73e7b 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -1556,6 +1556,7 @@ def id_(): "slesexpand": "RES", "linuxmint": "Mint", "neon": "KDE neon", + "pop": "Pop", } # Map the 'os' grain to the 'os_family' grain @@ -1628,6 +1629,7 @@ def id_(): "Funtoo": "Gentoo", "AIX": "AIX", "TurnKey": "Debian", + "Pop": "Debian", } # Matches any possible format: diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py index 34aaa4f5bc56..2f99f65f8afe 100644 --- a/tests/unit/grains/test_core.py +++ b/tests/unit/grains/test_core.py @@ -726,6 +726,46 @@ def test_ubuntu_artful_os_grains(self): } self._run_os_grains_tests("ubuntu-17.10", _os_release_map, expectation) + @skipIf(not salt.utils.platform.is_linux(), "System is not Linux") + def test_pop_focal_os_grains(self): + """ + Test if OS grains are parsed correctly in Pop!_OS 20.04 "Focal Fossa" + """ + _os_release_map = { + "_linux_distribution": ("Pop", "20.04", "focal"), + } + expectation = { + "os": "Pop", + "os_family": "Debian", + "oscodename": "focal", + "osfullname": "Pop", + "osrelease": "20.04", + "osrelease_info": (20, 4), + "osmajorrelease": 20, + "osfinger": "Pop-20", + } + self._run_os_grains_tests("pop-20.04", _os_release_map, expectation) + + @skipIf(not salt.utils.platform.is_linux(), "System is not Linux") + def test_pop_groovy_os_grains(self): + """ + Test if OS grains are parsed correctly in Pop!_OS 20.10 "Groovy Gorilla" + """ + _os_release_map = { + "_linux_distribution": ("Pop", "20.10", "groovy"), + } + expectation = { + "os": "Pop", + "os_family": "Debian", + "oscodename": "groovy", + "osfullname": "Pop", + "osrelease": "20.10", + "osrelease_info": (20, 10), + "osmajorrelease": 20, + "osfinger": "Pop-20", + } + self._run_os_grains_tests("pop-20.10", _os_release_map, expectation) + @skipIf(not salt.utils.platform.is_windows(), "System is not Windows") def test_windows_platform_data(self): """