3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2025-01-31 21:34:09 +01:00

autotests: utility: fix helper functions

This commit is contained in:
Rahul Rahul 2016-07-25 15:13:40 -07:00 committed by Denis Kenzior
parent eb605d9105
commit 866ff95c48

View File

@ -65,13 +65,18 @@ def disconnect(deviceToDisconnect, mainloop, bus):
return True
# get the 1st network found to connect to
def getNetworkToConnectTo(objects):
def getNetworkToConnectTo(objects, networkNameToMatch):
logger.debug(sys._getframe().f_code.co_name)
networkList = []
for path in objects:
if IWD_NETWORK_INTERFACE not in objects[path]:
continue
return path
if not networkNameToMatch:
return path
else:
network = objects[path][IWD_NETWORK_INTERFACE]
if network["Name"] == networkNameToMatch:
return path
return ""
# return the current connection status