Commit 04f4655
committed
util/agents/network_interface: handle wifis without SSID
Hidden wifis do not send an SSID. If a hidden wifi is in reach, the
following error can be observed:
Traceback (most recent call last):
File "/path/to/labgrid/examples/networkmanager/nm.py", line 68, in <module>
pprint(d.get_access_points())
^^^^^^^^^^^^^^^^^^^^^
File "/path/to/labgrid/labgrid/binding.py", line 102, in wrapper
return func(self, *_args, **_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/labgrid/labgrid/step.py", line 215, in wrapper
_result = func(*_args, **_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/labgrid/labgrid/driver/networkinterfacedriver.py", line 126, in get_access_points
return self.proxy.get_access_points(self.iface.ifname, scan)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/labgrid/labgrid/util/agentwrapper.py", line 29, in __call__
return self.wrapper.call(self.name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/labgrid/labgrid/util/agentwrapper.py", line 106, in call
raise AgentException(e)
labgrid.util.agentwrapper.AgentException: AttributeError("'NoneType' object has no attribute 'get_data'")
Fix that by retrieving the SSID only if it was received. The AP dict
will not contain the "ssid" key if no SSID was received.
Signed-off-by: Bastian Krause <bst@pengutronix.de>1 parent 92b0ec5 commit 04f4655
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
0 commit comments