Skip to content

Commit 0cd2c1d

Browse files
author
l0crian1
committed
T6452: Add QoS Op Commands
Added the following commands: show qos shaping show qos shaping detail show qos shaping interface <int name> show qos shaping interface <int name> detail show qos shaping interface <int name> class <class name> show qos shaping interface <int name> class <class name> detail show qos cake interface <int name>
1 parent 116f6de commit 0cd2c1d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/op_mode/qos.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,24 @@ def show_shaping(raw: bool, ifname: typing.Optional[str], classn: typing.Optiona
6363
raise vyos.opmode.Error(f"{ifname} does not exist!")
6464

6565
interface_dict = {ifname: op_mode_config_dict(['qos', 'interface', ifname], key_mangling=('-', '_'),
66-
get_first_key=True)}
66+
get_first_key=True)}
67+
if not interface_dict[ifname]:
68+
raise vyos.opmode.Error(f"QoS is not applied to {ifname}!")
69+
6770
else:
6871
interface_dict = op_mode_config_dict(['qos', 'interface'], key_mangling=('-', '_'),
6972
get_first_key=True)
73+
if not interface_dict:
74+
raise vyos.opmode.Error(f"QoS is not applied to any interface!")
75+
7076

7177
raw_dict = {'qos': {}}
7278
for i in interface_dict.keys():
7379
interface_name = i
7480
output_list = []
7581
output_dict = {'classes': {}}
7682
raw_dict['qos'][interface_name] = {}
77-
83+
7884
# Get configuration node data
7985
policy_name, class_dict = get_tc_info(interface_dict, interface_name, 'shaper')
8086

0 commit comments

Comments
 (0)