auto-t: Return None instead of empty known net list

To match the original behavior of get_ordered_networks,
return None for the empty list of known networks after the scan
is complete
This commit is contained in:
Tim Kourt 2020-05-07 12:20:21 -07:00 committed by Denis Kenzior
parent 2e5f7404c0
commit ae4b361f79
1 changed files with 4 additions and 1 deletions

View File

@ -395,8 +395,11 @@ class Device(IWDDBusAbstract):
ordered_network = OrderedNetwork(bus_obj) ordered_network = OrderedNetwork(bus_obj)
ordered_networks.append(ordered_network) ordered_networks.append(ordered_network)
if len(ordered_networks) > 0:
return ordered_networks return ordered_networks
return None
def get_ordered_network(self, network, scan_if_needed = False): def get_ordered_network(self, network, scan_if_needed = False):
'''Returns a single network from ordered network call, or None if the '''Returns a single network from ordered network call, or None if the
network wasn't found. If the network is not found an exception is network wasn't found. If the network is not found an exception is