python-distro / distro

A much more elaborate replacement for removed Python's `platform.linux_distribution()` method
https://distro.readthedocs.io/
Apache License 2.0
265 stars 66 forks source link

distro.version() and distro.build_number() returns incorrect build number information on ubuntu22.04.2 LTS #358

Closed pritamvkulkarni closed 1 year ago

pritamvkulkarni commented 1 year ago

This is specifically observed on Ubuntu22.04.2 LTS instances created on Azure and GCP cloud platforms where distro.build_number() returned incorrect information than the actual os build number. Following are screenshots for same -

image

HorlogeSkynet commented 1 year ago

Hi @pritamvkulkarni, could you give us the output of lsb_release -a, uname -rs and cat /etc/*release please ? 🙂

Thanks, bye 👋

pritamvkulkarni commented 1 year ago

@HorlogeSkynet , please find output as follows:

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy

$ uname -rs Linux 5.15.0-1029-gcp

$ cat /etc/*release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS" PRETTY_NAME="Ubuntu 22.04.2 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.2 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

pritamvkulkarni commented 1 year ago

Upon primary investigation and tracing code flow, observed that script is reading this incorrect version from /etc/ec2_version file that is present on these instances. We may want to add this file in _DISTRO_RELEASE_IGNORE_BASENAMES after which it works as expected.

pritamvkulkarni commented 1 year ago

request to add me as contributers

HorlogeSkynet commented 1 year ago

Yes that should do it. You are allowed to open a pull request 😉

pritamvkulkarni commented 1 year ago

Unfortunately, I am not able to create a branch or a pull request, facing 403 forbidden. Can someone please grant me required permissions to create a branch and pull request on this repo?

HorlogeSkynet commented 1 year ago

You may not create a branch nor push to an existing one on this repository. Please fork it using the button near the top bar, and then follow this documentation to create a pull request from your fork branch. Thanks, bye :wave:

HorlogeSkynet commented 1 year ago

Closing here as PR is on its way.