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

auto-t: allow printing devices in AP mode

The __str__ function assumed station mode which throws an exception
if the device is in AP mode. Fix this as well as print out the mode
the device is in.
This commit is contained in:
James Prestwood 2022-10-26 11:56:54 -07:00 committed by Denis Kenzior
parent 8bc871ba62
commit 1f9d9e1eb1

View File

@ -690,14 +690,17 @@ class Device(IWDDBusAbstract):
return self._device_provisioning.stop() return self._device_provisioning.stop()
def __str__(self, prefix = ''): def __str__(self, prefix = ''):
return prefix + 'Device: ' + self.device_path + '\n'\ s = prefix + 'Device: ' + self.device_path + '\n'\
+ prefix + '\tName:\t\t' + self.name + '\n'\ + prefix + '\tName:\t\t' + self.name + '\n'\
+ prefix + '\tAddress:\t' + self.address + '\n'\ + prefix + '\tAddress:\t' + self.address + '\n' \
+ prefix + '\tState:\t\t' + str(self.state) + '\n'\
+ prefix + '\tPowered:\t' + str(self.powered) + '\n'\ + prefix + '\tPowered:\t' + str(self.powered) + '\n'\
+ prefix + '\tConnected net:\t' + str(self.connected_network) +\ + prefix + '\tMode:\t\t' + self._properties['Mode'] + '\n'
'\n'
if self._properties['Mode'] == 'station':
s += prefix + '\tState:\t\t' + str(self.state) + '\n'\
+ prefix + '\tConnected net:\t' + str(self.connected_network) + '\n'
return s
class Network(IWDDBusAbstract): class Network(IWDDBusAbstract):
'''Class represents a network object: net.connman.iwd.Network''' '''Class represents a network object: net.connman.iwd.Network'''