https://github.com/linbit/python-lbdist
LINBIT opinionated Python library for Linux distribution detection
https://github.com/linbit/python-lbdist
Last synced: about 1 month ago
JSON representation
LINBIT opinionated Python library for Linux distribution detection
- Host: GitHub
- URL: https://github.com/linbit/python-lbdist
- Owner: LINBIT
- Created: 2020-02-14T14:54:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T09:24:51.000Z (over 3 years ago)
- Last Synced: 2025-02-13T00:33:50.396Z (over 1 year ago)
- Language: Python
- Size: 28.3 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lbdist - LINBIT distribution detection library for Python
This is a opinionated Linux distribution detection library. This was initially written for
`linbit-manage-node.py` when we made it Python 3 clean. Python 3 dropped `platform.linux_distribution()`, which
is very much understandable considering the enormous mess Linux distribution detection is. `/etc/os-release`
helps, there are still differences even where one would not expect them (RHEL vs. Centos vs. RHEL CoreOS,...).
Why not use an existing one? We at LINBIT have a pretty specific naming scheme (e.g., how many digits of the
version, where and how we mangle service pack levels,...), so existing ones are not a perfect fit. We also care
about distributions that others might not, and we don't care about others not relevant to us. All in all,
providing a mapping from `$library` to "LINBIT notation" did not look like a good idea.
The `Distribution` class might be handy for more general cases, but is already slightly opinionated,
`LinbitDistribution` extends this class and provides highly LINBIT specific methods.
This library should still work on very old Python (2.6 as of RHEL6).
`distribution.py` is written in a way that it can be used as a library and a standalone program. We will try
to keep the output of the standalone version compatible. New fields will be printed after the existing ones.