Skip to content

[Static route] Add Multiasic support (#1608) #1870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 9 additions & 4 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4375,13 +4375,18 @@ def del_vrf_vni_map(ctx, vrfname):
#

@config.group(cls=clicommon.AbbreviationGroup)
@click.option('-n', '--namespace', help='Namespace name',
required=True if multi_asic.is_multi_asic() else False,
type=click.Choice(multi_asic.get_namespace_list()))
@click.pass_context
def route(ctx):
def route(ctx, namespace):
"""route-related configuration tasks"""
config_db = ConfigDBConnector()
# Set namespace to default_namespace if it is None.
if namespace is None:
namespace = DEFAULT_NAMESPACE
config_db = ConfigDBConnector(use_unix_socket_path=True, namespace=str(namespace))
config_db.connect()
ctx.obj = {}
ctx.obj['config_db'] = config_db
ctx.obj = {'config_db': config_db, 'namespace': str(namespace)}

@route.command('add', context_settings={"ignore_unknown_options":True})
@click.argument('command_str', metavar='prefix [vrf <vrf_name>] <A.B.C.D/M> nexthop <[vrf <vrf_name>] <A.B.C.D>>|<dev <dev_name>>', nargs=-1, type=click.Path())
Expand Down