distro
distro copied to clipboard
the distro.id() report different id other than lsb_release on CentosStream
version: 1.4.0
lsb_release -i -s is CentOSStream. But distro.id() is centos. The distro.version() is report as 8. There seems no way to distinguish the centos8-stream and centos8, except using the distro.name().
Hi @braindevices, sorry for the delay.
I don't want to answer for the whole team, but here are my thoughts on this issue :
-
distroprefers (normalized)OS-RELEASEidentifier shipped by distribution, and only falls back onlsb_releasewhen the former is not available (see Background) ; - this might be an upstream issue if distribution ids differ between
OS-RELEASEandlsb_releaseoutput ; - the underlying question is : Do CentOS developers consider CentOS Stream as a different distribution from CentOS (in
OS-RELEASEterms) ?
Below is a short Python snippet developers may use to handle CentOS Stream if they need to :
import distro
is_centos_stream = distro.id() == "centos" and distro.version() >= "8"
if is_centos_stream:
# ...
Thanks for your time, tell us if we could close this issue or not. Bye :wave:
Closing here due to age, please re-open if distro is actually failing to do its job/this is not an upstream issue 🙏