From 75b5578cfb39e33fb7da92bcdaa5ac76994bc935 Mon Sep 17 00:00:00 2001 From: epheo Date: Wed, 14 Feb 2024 23:41:42 +0100 Subject: [PATCH] Fix WiFi connection on RHEL based systems 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")