#9010 [ipaplatform] osinfo parser and VERSION_ID
Opened 2 years ago by slev. Modified 2 years ago

According to https://www.freedesktop.org/software/systemd/man/os-release.html#VERSION_ID=

VERSION_ID=
A lower-case string (mostly numeric, no spaces or other characters outside of 0–9, a–z, ".", "_" and "-") identifying the operating system version, excluding any OS name information or release code name, and suitable for processing by scripts or usage in generated filenames. This field is optional.

Examples: "VERSION_ID=17", "VERSION_ID=11.04".

IPA assumes that VERSION_ID can contain only digits and optionally dots and fails on any other symbols.
ipaplatform/osinfo.py::OSInfo::version_number:

175     @property                                                                   
176     def version_number(self):                                                   
177         """Version number tuple based on version_id                             
178         """                                                                     
179         version_id = self._info.get('VERSION_ID')                               
180         if not version_id:                                                      
181             return ()                                                           
182         return tuple(int(p) for p in version_id.split('.'))

It may be a good idea to make it platform-dependent.


Login to comment on this ticket.

Metadata