Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clear/stp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ 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)


@stp_clr_stats.command('interface')
@click.argument('interface_name', metavar='<interface_name>', 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)


@stp_clr_stats.command('vlan')
@click.argument('vlan_id', metavar='<vlan_id>', 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)


Expand All @@ -42,5 +42,5 @@ def stp_clr_stats_vlan(ctx, vlan_id):
@click.argument('interface_name', metavar='<interface_name>', 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)
command = ['sudo', 'stpctl', 'clrstsvlanintf', '{}'.format(vlan_id), '{}'.format(interface_name)]
clicommon.run_command(command)