Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal information detected when lsb-release isn't installed #152

Closed
lenormf opened this issue Dec 7, 2016 · 8 comments
Closed

Minimal information detected when lsb-release isn't installed #152

lenormf opened this issue Dec 7, 2016 · 8 comments

Comments

@lenormf
Copy link

lenormf commented Dec 7, 2016

Hi,

I hit this bug while using the distro module in a Debian Stretch docker container:

>>> distro._distroi.linux_distribution()
('Debian GNU/Linux', '', '')
>>> distro._distroi.info()
{'like': '', 'codename': '', 'id': 'debian', 'version': '', 'version_parts': {'build_number': '', 'major': '', 'minor': ''}}

Expected output:

>>> distro.linux_distribution()
('Debian GNU/Linux', 'testing', 'stretch')
>>> distro.info()
{'like': '', 'version': 'testing', 'codename': 'stretch', 'id': 'debian', 'version_parts': {'major': '', 'build_number': '', 'minor': ''}}

The /etc/os-release:

PRETTY_NAME="Debian GNU/Linux stretch/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Everything worked fine when I installed the lsb-release package, but I was under the impression that I wouldn't need it in the first place.

HTH.

@nir0s
Copy link
Collaborator

nir0s commented Jan 12, 2017

@lenormf I assume you mean that you would expect to see "stretch/sid" in the codename?

@lenormf
Copy link
Author

lenormf commented Jan 12, 2017

Sorry, I hadn't included the expected output. I think the codename should indeed be stretch/sid, or just stretch as seems to be the case on some systems.

@nir0s
Copy link
Collaborator

nir0s commented Jan 15, 2017

Unfortunately, this seems to be something that will have to be addressed as part of #109.

In debian 8, the codename appeared in parentheses and in stretch, it isn't. That's inconsistent with almost all distributions. It's also rather sad that they're not providing the version anymore.

PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"

I will start working on a distro inconsistencies framework soon, at which point i'll address this as well.

@asottile
Copy link
Contributor

asottile commented Dec 3, 2017

fwiw, the latest stretch docker image has an os-release file that looks like this:

root@a83fb62a5bc1:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

and these look roughly correct:

>>> distro.linux_distribution()
('Debian GNU/Linux', '9', 'stretch')
>>> distro.info()
{'version': '9', 'codename': 'stretch', 'version_parts': {'major': '9', 'minor': '', 'build_number': ''}, 'id': 'debian', 'like': ''}

@nir0s
Copy link
Collaborator

nir0s commented Dec 30, 2017

I'm confused. In Docker it's different? :)

@asottile
Copy link
Contributor

The information from when this ticket was created was when stretch was not yet a released version. Debian in this case chose to not fill out the release information. It is filed out now that it is released however \o/

@sethmlarson
Copy link
Contributor

So can this be closed?

@asottile
Copy link
Contributor

I believe so, yes

@nir0s nir0s closed this as completed Dec 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants