summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-23 15:40:52 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-23 15:40:52 +0100
commit6b7bcdad6abaf05bc6fc8f71d918bd161389cdfb (patch)
tree7b886edf829f46400eea06f6af13841d2208ad75
parent1ef61b008f3bd3756251298e6d67ec2a2e581646 (diff)
downloadvyos-1x-6b7bcdad6abaf05bc6fc8f71d918bd161389cdfb.tar.gz
vyos-1x-6b7bcdad6abaf05bc6fc8f71d918bd161389cdfb.zip
op-mode: wireless: T3084: fix TypeError
-rwxr-xr-xsrc/op_mode/show_wireless.py17
1 files changed, 5 insertions, 12 deletions
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