Skip to content

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

Closed

Description

@lenormf

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.

Activity

  1. nir0s commented on Jan 12, 2017

    @nir0s
    Collaborator

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

  2. lenormf commented on Jan 12, 2017

    @lenormf
    Author

    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.

  3. nir0s commented on Jan 15, 2017

    @nir0s
    Collaborator

    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.

  4. asottile commented on Dec 3, 2017

    @asottile
    Contributor

    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': ''}
    
  5. nir0s commented on Dec 30, 2017

    @nir0s
    Collaborator

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

  6. asottile commented on Dec 30, 2017

    @asottile
    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/

  7. sethmlarson commented on Dec 31, 2017

    @sethmlarson
    Contributor

    So can this be closed?

  8. asottile commented on Dec 31, 2017

    @asottile
    Contributor

    I believe so, yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions