From 6b7bcdad6abaf05bc6fc8f71d918bd161389cdfb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 23 Nov 2020 15:40:52 +0100 Subject: op-mode: wireless: T3084: fix TypeError --- src/op_mode/show_wireless.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/op_mode/show_wireless.py b/src/op_mode/show_wireless.py index b5ee3aee1..19ab6771c 100755 --- a/src/op_mode/show_wireless.py +++ b/src/op_mode/show_wireless.py @@ -28,7 +28,6 @@ parser.add_argument("-s", "--scan", help="Scan for Wireless APs on given interfa parser.add_argument("-b", "--brief", action="store_true", help="Show wireless configuration") parser.add_argument("-c", "--stations", help="Show wireless clients connected on interface, e.g. 'wlan0'") - def show_brief(): config = Config() if len(config.list_effective_nodes('interfaces wireless')) == 0: @@ -37,17 +36,11 @@ def show_brief(): interfaces = [] for intf in config.list_effective_nodes('interfaces wireless'): - config.set_level('interfaces wireless {}'.format(intf)) - data = { - 'name': intf, - 'type': '', - 'ssid': '', - 'channel': '' - } - data['type'] = config.return_effective_value('type') - data['ssid'] = config.return_effective_value('ssid') - data['channel'] = config.return_effective_value('channel') - + config.set_level(f'interfaces wireless {intf}') + data = { 'name': intf } + data['type'] = config.return_effective_value('type') or '-' + data['ssid'] = config.return_effective_value('ssid') or '-' + data['channel'] = config.return_effective_value('channel') or '-' interfaces.append(data) return interfaces -- cgit v1.2.3