-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fix Pop!_OS 20.04 not using aptpkg #58443
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
Conversation
Perhaps salt should check for That could make it more robust for running on various distros, without necessarily hard-coding each distro's |
This has fixed my inability to manage Pop!_OS systems, and I find myself applying this change manually to each update of Salt. I haven't tested on Pop!_OS I think this would be a good fix/update to apply to Salt, and then have a separate issue regarding the suggestion by @ids1024 in a future update to Salt for better general reach across different OS spinoffs. See new issue: #59061 To fulfill the |
We need at least a Unit test case which ensures PopOS is properly identified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that we could introduce valuable unit testing for this, since we are only extending two dictionaries to provide an Ubuntu-derivative the ability to call aptpkg.*
and pkg.*
execution and state modules.
This would allow for Salt to execute package management on Pop!_OS, and #59061 being addressed will assist in the default reach of Salt on wider derivatives without hardcoding into Salt.
UPDATE: Based on @whytewolf's response, @thehunmonkgroup see below comments for guidance on unit test guidance for this PR
actually writing a test for this wouldn't be that difficult. most of the work is already done, Just add a new stanza pretty much like this one in the test_core.py https://github.com/saltstack/salt/blob/master/tests/unit/grains/test_core.py#L690-L707 |
Ah! Got it, so based on that, we'd want something like the following added to @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) |
yeap, in theory. @waynew would know if I am leading you down the wrong path. |
a1363c0
to
75f8b74
Compare
I tossed in the tests suggested by @whytewolf , hopefully that will be enough? |
Congratulations on your first PR being merged! 🎉 |
What does this PR do?
Pop!_OS 20.04 not recognized as aptpkg for pkg states
What issues does this PR fix or reference?
Fixes: #58395
Previous Behavior
aptpkg is not selected for pkg states
New Behavior
aptpkg is selected for pkg states
Merge requirements satisfied?
Commits signed with GPG?
No
NOTE: I'm far from a Salt developer, and just trying to get the ball rolling here.
It's unclear if a test is necessary, it didn't look like most other stuff in the
_OS_FAMILY_MAP
had one.By a quick test, this patch now reports the correct os and os_family:
And pkg.installed also works.