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

[Next] Refactor LinuxDistro class #376

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ygerlach
Copy link
Contributor

@ygerlach ygerlach commented Dec 7, 2024

This is based on #333. So #333 should be merged first. Only the last commit (670e86d) is new.

The class LinuxDistro used to check for the files and then reading them. This is a time-of-check-time-of-use bug. Of cause it would probably never trigger in the open, i guess it is a good idea to get rid of it. Now cases like the file exists, but is not readable (wrong permissions, file type, ...) are also handled. The class also used string.split on the same string multiple times. I changed that.

I also deduplicted the code used for parsing /etc/lsb-release and /etc/os-release and added the removing of leading and trailing " to /etc/os-release (/etc/lsb-release had it already)

@ygerlach ygerlach force-pushed the refactorLinuxDistro branch from e427d80 to 670e86d Compare December 7, 2024 17:28
@clefebvre clefebvre changed the title Refactor LinuxDistro class [Next] Refactor LinuxDistro class Dec 19, 2024
@ygerlach ygerlach force-pushed the refactorLinuxDistro branch from 670e86d to 7185509 Compare January 1, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant