Skip to content

Commit

Permalink
Fix WiFi connection on RHEL based systems
Browse files Browse the repository at this point in the history
On RHEL based systems, the version is in the form of 1.44.2-1.fc39
wich raises an error when trying to compare it with the Version class.

This fix remove non alphabetical values from the version string if any.
  • Loading branch information
epheo committed Feb 14, 2024
1 parent 90e8965 commit 75b5578
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def _detect_driver(self) -> WifiController:
# try nmcli (Ubuntu 14.04). Allow for use in Snap Package
if which("nmcli") or which("nmcli", path="/snap/bin/"):
version = cmd("nmcli --version").split()[-1]
# On RHEL based systems, the version is in the form of 1.44.2-1.fc39
# wich raises an error when trying to compare it with the Version class
if any(c.isalpha() for c in version):
version = version.split("-")[0]
return (
Nmcli0990Wireless(password=self._password)
if Version(version) >= Version("0.9.9.0")
Expand Down

0 comments on commit 75b5578

Please sign in to comment.