Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into remove-fc-delay

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak committed Dec 4, 2024
2 parents c3bbe05 + b767cb8 commit 0a3be59
Show file tree
Hide file tree
Showing 105 changed files with 8,419 additions and 554 deletions.
24 changes: 23 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ stages:
sudo dpkg -i libyang_1.0.73_amd64.deb
sudo dpkg -i libyang-cpp_1.0.73_amd64.deb
sudo dpkg -i python3-yang_1.0.73_amd64.deb
sudo dpkg -i libprotobuf*.deb
workingDirectory: $(Pipeline.Workspace)/target/debs/bullseye/
displayName: 'Install Debian dependencies'
Expand All @@ -104,6 +105,27 @@ stages:
workingDirectory: $(Pipeline.Workspace)/
displayName: 'Install swss-common dependencies'
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: sonic-net.sonic-dash-api
artifact: sonic-dash-api
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
libdashapi*.deb
displayName: "Download dash api"

- script: |
set -xe
sudo apt-get update
sudo dpkg -i $(Build.ArtifactStagingDirectory)/download/libdashapi_*.deb
workingDirectory: $(Pipeline.Workspace)/
displayName: 'Install libdashapi libraries'
- script: |
set -xe
sudo pip3 install swsssdk-2.0.1-py3-none-any.whl
Expand All @@ -121,7 +143,7 @@ stages:
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/11/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
sudo apt-get install -y dotnet-sdk-8.0
displayName: "Install .NET CORE"
- script: |
Expand Down
6 changes: 5 additions & 1 deletion clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from show.plugins.pbh import read_pbh_counters
from config.plugins.pbh import serialize_pbh_counters
from . import plugins

from . import stp
# This is from the aliases example:
# https://github.com/pallets/click/blob/57c6f09611fc47ca80db0bd010f05998b3c0aa95/examples/aliases/aliases.py
class Config(object):
Expand Down Expand Up @@ -145,6 +145,10 @@ def ipv6():
pass


# 'STP'
#
cli.add_command(stp.spanning_tree)

#
# Inserting BGP functionality into cli's clear parse-chain.
# BGP commands are determined by the routing-stack being elected.
Expand Down
46 changes: 46 additions & 0 deletions clear/stp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import click
import utilities_common.cli as clicommon

#
# This group houses Spanning_tree commands and subgroups
#


@click.group(cls=clicommon.AliasedGroup)
@click.pass_context
def spanning_tree(ctx):
'''Clear Spanning-tree counters'''
pass


@spanning_tree.group('statistics', cls=clicommon.AliasedGroup, invoke_without_command=True)
@click.pass_context
def stp_clr_stats(ctx):
if ctx.invoked_subcommand is None:
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
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
clicommon.run_command(command)


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

0 comments on commit 0a3be59

Please sign in to comment.