Skip to content

Commit

Permalink
#4097 controller and master are indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 13, 2024
1 parent b7225fd commit 5972ddc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xpra/net/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ def get_NM_adapter_type(device_name) -> str:
if not connection:
return ""
try:
nmdevice = connection.get_controller()
index = connection.get_controller()
except AttributeError:
nmdevice = connection.get_master()
index = connection.get_master()
try:
nmdevice = nmclient.get_devices()[index]
except IndexError as e:
log(f"invalid device index {index}: {e}")
return ""
if not nmdevice:
return ""
log(f"NM device {device_name!r}: {nmdevice.get_vendor()} {nmdevice.get_product()}")
Expand Down

0 comments on commit 5972ddc

Please sign in to comment.