From 9c64df545f2ba21a6e2cda29d132389c71fac144 Mon Sep 17 00:00:00 2001 From: khramshinr Date: Mon, 22 Jul 2024 12:52:40 +0600 Subject: T6589: Return a dict when querying information about a single interface --- src/op_mode/interfaces.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/op_mode/interfaces.py') 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], -- cgit v1.2.3