Skip to content

Commit

Permalink
[policies] Fix dist_version for Ubuntu
Browse files Browse the repository at this point in the history
DISTRIB_RELEASE variable contains a float value for the Ubuntu
release version and not an integer value.

Example, a 22.04 release is an LTS release, and a 22.10 release
is an interim non-LTS release, changing this value to a float
allows us to retrieve the full version rather than just the int.

Signed-off-by: David Negreira <[email protected]>
  • Loading branch information
dnegreira authored and arif-ali committed Jan 12, 2024
1 parent 769768a commit e0b1ece
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sos/policies/distros/ubuntu.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def dist_version(self):
lines = fp.readlines()
for line in lines:
if "DISTRIB_RELEASE" in line:
return int(line.split("=")[1].strip())
return float(line.split("=")[1].strip())
return False
except (IOError, ValueError):
return False
Expand Down

0 comments on commit e0b1ece

Please sign in to comment.