3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

auto-t: pass namespace on to other IWD classes

Certain classes were still using the default namespace. This
didn't matter yet since testAP was the only test using namespaces,
and the AP interface was the only one being used.

For an IWD station on a separate namespace all objects need to
be accessable, so the namespace is passed along to those as needed.
This commit is contained in:
James Prestwood 2020-12-10 09:45:21 -08:00 committed by Denis Kenzior
parent b18f843532
commit d2cc033d09

View File

@ -124,6 +124,7 @@ class IWDDBusAbstract(AsyncOpAbstract):
def __init__(self, object_path = None, properties = None, service=IWD_SERVICE, namespace=ctx): def __init__(self, object_path = None, properties = None, service=IWD_SERVICE, namespace=ctx):
self._bus = namespace.get_bus() self._bus = namespace.get_bus()
self._namespace = namespace
self._object_path = object_path self._object_path = object_path
proxy = self._bus.get_object(service, self._object_path) proxy = self._bus.get_object(service, self._object_path)
@ -391,7 +392,7 @@ class Device(IWDDBusAbstract):
''' '''
ordered_networks = [] ordered_networks = []
for bus_obj in self._station.GetOrderedNetworks(): for bus_obj in self._station.GetOrderedNetworks():
ordered_network = OrderedNetwork(bus_obj, self._bus) ordered_network = OrderedNetwork(bus_obj, self._bus, self._namespace)
ordered_networks.append(ordered_network) ordered_networks.append(ordered_network)
if len(ordered_networks) > 0: if len(ordered_networks) > 0:
@ -407,7 +408,7 @@ class Device(IWDDBusAbstract):
IWD._wait_for_object_condition(self, condition) IWD._wait_for_object_condition(self, condition)
for bus_obj in self._station.GetOrderedNetworks(): for bus_obj in self._station.GetOrderedNetworks():
ordered_network = OrderedNetwork(bus_obj, self._bus) ordered_network = OrderedNetwork(bus_obj, self._bus, self._namespace)
ordered_networks.append(ordered_network) ordered_networks.append(ordered_network)
if len(ordered_networks) > 0: if len(ordered_networks) > 0:
@ -643,9 +644,9 @@ class KnownNetwork(IWDDBusAbstract):
class OrderedNetwork(object): class OrderedNetwork(object):
'''Represents a network found in the scan''' '''Represents a network found in the scan'''
def __init__(self, o_n_tuple, bus): def __init__(self, o_n_tuple, bus, namespace=ctx):
self._bus = bus self._bus = bus
self._network_object = Network(o_n_tuple[0]) self._network_object = Network(o_n_tuple[0], namespace=namespace)
self._network_proxy = dbus.Interface(self._bus.get_object(IWD_SERVICE, self._network_proxy = dbus.Interface(self._bus.get_object(IWD_SERVICE,
o_n_tuple[0]), o_n_tuple[0]),
DBUS_PROPERTIES) DBUS_PROPERTIES)