Proper way to extract Product, Release, Update, etc...
I'm trying to come up with a consistent way to extract the product, release, update, etc... of a RHEL release, update, etc..., but one that could also apply to more than just RHEL. So far, this is the testing I've come up with, in order of testing ...
1) Common Platform Enumeration (CPE), colon separated values (:): /etc/system-release-cpe
Field #1 = cpe
Field #3 = 'vendor' (e.g., redhat)
Field #4 = 'product' (e.g., enterprise_linux)
Field #5 = 'version' (e.g., 7.3)
Field #7 = 'edition' (e.g., server)
2) OS Release, key=value pairing: /etc/os-release
CPE_NAME='cpe' (e.g., same string as in #1)
ID='product' (e.g., "rhel")
VERSION_ID='version' (e.g., "7.3")
3) System Release, vendor string: /etc/system-release (also via symlink, or legacy, /etc/fedora-release, /etc/redhat-release)
vendor [product] [edition] version ([codename])
E.g.,
Fedora release 24
Red Hat Enterprise Linux Server release 7.1 (Maipo)
Does Red Hat or anyone maintain code to read these entries in shell, python, etc...? I was kinda disappointed in all implements, other than the CPE, which actually does break out vendor, version and edition quite well ... everything but architecture (which can be found with 'uname -m').