Skip to content

Commit

Permalink
Merge pull request #971 from ahesford/master
Browse files Browse the repository at this point in the history
Nagstamon.Helpers.get_distro: ignore lines missing an equal sign
  • Loading branch information
HenriWahl authored Oct 10, 2023
2 parents 1ebf9b5 + a92d5b3 commit e4397b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Nagstamon/Helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,9 @@ def get_distro():
os_release_dict = {}
for line in os_release_file.read_text().splitlines():
if not line.startswith('#'):
key, value = line.split('=', 1)
os_release_dict[key] = value.strip('"').strip("'")
try: key, value = line.split('=', 1)
except ValueError: continue
else: os_release_dict[key] = value.strip('"').strip("'")
# Since CentOS Linux got retired by Red Hat, there are various RHEL derivatives/clones; flow is:
# CentOS Stream -> Red Hat Enterprise Linux -> (AlmaLinux, EuroLinux, Oracle Linux, Rocky Linux)
# Goal of this hack is to rule them all as Red Hat Enterprise Linux, the baseline distribution.
Expand Down

0 comments on commit e4397b5

Please sign in to comment.