mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-05-05 08:37:23 +02:00
autotests: utility: fix helper functions
This commit is contained in:
parent
eb605d9105
commit
866ff95c48
@ -65,12 +65,17 @@ def disconnect(deviceToDisconnect, mainloop, bus):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
# get the 1st network found to connect to
|
# get the 1st network found to connect to
|
||||||
def getNetworkToConnectTo(objects):
|
def getNetworkToConnectTo(objects, networkNameToMatch):
|
||||||
logger.debug(sys._getframe().f_code.co_name)
|
logger.debug(sys._getframe().f_code.co_name)
|
||||||
networkList = []
|
networkList = []
|
||||||
for path in objects:
|
for path in objects:
|
||||||
if IWD_NETWORK_INTERFACE not in objects[path]:
|
if IWD_NETWORK_INTERFACE not in objects[path]:
|
||||||
continue
|
continue
|
||||||
|
if not networkNameToMatch:
|
||||||
|
return path
|
||||||
|
else:
|
||||||
|
network = objects[path][IWD_NETWORK_INTERFACE]
|
||||||
|
if network["Name"] == networkNameToMatch:
|
||||||
return path
|
return path
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user