Skip to content

Commit

Permalink
fix debian and Ubuntu version detection
Browse files Browse the repository at this point in the history
This fixes an issue with the Debian version information where it was
retrieving a number instead of the codename.
This also fixes an issue where the version of Ubuntu was incomplete and
it was retrieving only the first part of it, rather than the full
version.

Signed-off-by: David Negreira <[email protected]>
  • Loading branch information
dnegreira committed Sep 13, 2024
1 parent 536b6f7 commit a44d5ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions avocado/utils/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class DebianProbe(Probe):

CHECK_FILE = "/etc/debian_version"
CHECK_FILE_DISTRO_NAME = "debian"
CHECK_VERSION_REGEX = re.compile(r"(\d+)\.(\d+)")
CHECK_VERSION_REGEX = re.compile(r"(.+)/(.+)")


class UbuntuProbe(Probe):
Expand All @@ -399,7 +399,7 @@ class UbuntuProbe(Probe):
CHECK_FILE_CONTAINS = "ubuntu"
CHECK_FILE_DISTRO_NAME = "Ubuntu"
CHECK_VERSION_REGEX = re.compile(
r".*VERSION_ID=\"(\d+)\.(\d+)\".*", re.MULTILINE | re.DOTALL
r".*VERSION_ID=\"(\d+\.\d+)\".*", re.MULTILINE | re.DOTALL
)


Expand Down

0 comments on commit a44d5ab

Please sign in to comment.