Skip to content

Refactor osdetect for rhel family OSes#464

Open
fabi200123 wants to merge 1 commit into
cloudbase:masterfrom
fabi200123:refactor-osdetect
Open

Refactor osdetect for rhel family OSes#464
fabi200123 wants to merge 1 commit into
cloudbase:masterfrom
fabi200123:refactor-osdetect

Conversation

@fabi200123

@fabi200123 fabi200123 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR refactors the osdetect for the OSes that are RHEL related. It adds a common.py where the detect_os_from_os_release is defined to return the proper info from /etc/os-release:

    return {
        "os_type": constants.OS_TYPE_LINUX,
        "distribution_name": distribution_name,
        "release_version": version,
        "friendly_release_name": "%s Version %s" % (
            distribution_name, version)}

NOTE: Due to the use of /etc/os-release, which was introduced starting with OSes like RedHat version 7 (e.g. RHEL 7, CentOS 7, OL7), this implementation makes the previous RedHat version 6 OSes to not work with the current logic for detecting OSes.

@fabi200123 fabi200123 marked this pull request as draft July 1, 2026 09:34
@fabi200123 fabi200123 force-pushed the refactor-osdetect branch from bfd6e77 to a4ee503 Compare July 1, 2026 10:37
@fabi200123 fabi200123 marked this pull request as ready for review July 1, 2026 11:14
Comment thread coriolis/osmorphing/osdetect/common.py Outdated
Comment thread coriolis/osmorphing/osdetect/common.py Outdated
Comment thread coriolis/osmorphing/osdetect/common.py Outdated
Comment thread coriolis/osmorphing/osdetect/common.py Outdated
Comment thread coriolis/osmorphing/osdetect/common.py Outdated
Comment thread coriolis/osmorphing/osdetect/common.py Outdated
distribution_name, version)}
return info
return common.detect_os_from_os_release(
self._get_os_release(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RHEL 6 and derivate OS-es do not have the /etc/os-release file. Are we going to drop RHEL 6 support? If so, the PR description must clearly state it. We can also remove RHEL 6 specific os-morphing code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a NOTE in the PR description mentioning the /etc/os-release was added starting Redhat version 7, anything before not having it and thus the logic not working for them.

@fabi200123 fabi200123 force-pushed the refactor-osdetect branch from a4ee503 to 3a1a592 Compare July 9, 2026 11:26
@fabi200123 fabi200123 force-pushed the refactor-osdetect branch from 3a1a592 to cc41923 Compare July 9, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants