From 3924ed95453663281db0ee5c02ec667ffcc73c1e Mon Sep 17 00:00:00 2001 From: Thibaut Lapierre Date: Wed, 10 Apr 2024 21:24:41 +0200 Subject: [PATCH] Fix WiFi connection on RHEL based systems (#482) 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. --- .../open_gopro/wifi/adapters/wireless.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py b/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py index 899888bf..974c8419 100644 --- a/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py +++ b/demos/python/sdk_wireless_camera_control/open_gopro/wifi/adapters/wireless.py @@ -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")