From fb811c6beffe226b48426c514085e457de915b5f Mon Sep 17 00:00:00 2001 From: twtseng-tim <59221293+twtseng-tim@users.noreply.github.com> Date: Fri, 15 Aug 2025 18:02:44 +0800 Subject: [PATCH] fix stp clear cli --- clear/stp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clear/stp.py b/clear/stp.py index 49c012f8..f458b469 100644 --- a/clear/stp.py +++ b/clear/stp.py @@ -17,7 +17,7 @@ def spanning_tree(ctx): @click.pass_context def stp_clr_stats(ctx): if ctx.invoked_subcommand is None: - command = 'sudo stpctl clrstsall' + command = ['sudo', 'stpctl', 'clrstsall'] clicommon.run_command(command) @@ -25,7 +25,7 @@ def stp_clr_stats(ctx): @click.argument('interface_name', metavar='', required=True) @click.pass_context def stp_clr_stats_intf(ctx, interface_name): - command = 'sudo stpctl clrstsintf ' + interface_name + command = ['sudo', 'stpctl', 'clrstsintf', '{}'.format(interface_name)] clicommon.run_command(command) @@ -33,7 +33,7 @@ def stp_clr_stats_intf(ctx, interface_name): @click.argument('vlan_id', metavar='', required=True) @click.pass_context def stp_clr_stats_vlan(ctx, vlan_id): - command = 'sudo stpctl clrstsvlan ' + vlan_id + command = ['sudo', 'stpctl', 'clrstsvlan', '{}'.format(vlan_id)] clicommon.run_command(command) @@ -42,5 +42,5 @@ def stp_clr_stats_vlan(ctx, vlan_id): @click.argument('interface_name', metavar='', required=True) @click.pass_context def stp_clr_stats_vlan_intf(ctx, vlan_id, interface_name): - command = 'sudo stpctl clrstsvlanintf ' + vlan_id + ' ' + interface_name - clicommon.run_command(command) \ No newline at end of file + command = ['sudo', 'stpctl', 'clrstsvlanintf', '{}'.format(vlan_id), '{}'.format(interface_name)] + clicommon.run_command(command)