summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorkhramshinr <khramshinr@gmail.com>2024-07-22 12:52:40 +0600
committerkhramshinr <khramshinr@gmail.com>2024-07-22 12:52:40 +0600
commit9c64df545f2ba21a6e2cda29d132389c71fac144 (patch)
tree078f66a1f8f2e2211d3e52333822066d67667e6b /src/op_mode
parentda3d9415542d57a64322665efd16024ce92330dd (diff)
downloadvyos-1x-9c64df545f2ba21a6e2cda29d132389c71fac144.tar.gz
vyos-1x-9c64df545f2ba21a6e2cda29d132389c71fac144.zip
T6589: Return a dict when querying information about a single interface
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/interfaces.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/op_mode/interfaces.py b/src/op_mode/interfaces.py
index 14ffdca9f..50199eed5 100755
--- a/src/op_mode/interfaces.py
+++ b/src/op_mode/interfaces.py
@@ -458,7 +458,10 @@ def show_summary(raw: bool, intf_name: typing.Optional[str],
vif: bool, vrrp: bool):
data = _get_summary_data(intf_name, intf_type, vif, vrrp)
if raw:
- return data
+ if intf_name is not None and len(data) <= 1:
+ return data[0] if data else {}
+ else:
+ return data
return _format_show_summary(data)
def show_summary_extended(raw: bool, intf_name: typing.Optional[str],