Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion doc/Command-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5435,7 +5435,7 @@ This command is used to display the list of expected neighbors for all interface

- Usage:
```
show interfaces neighbor expected [<interface_name>]
show interfaces neighbor expected [<interface_name>] -n [<namespace>]
```

- Example:
Expand Down
10 changes: 7 additions & 3 deletions show/interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,20 @@ def neighbor():
# 'expected' subcommand ("show interface neighbor expected")
@neighbor.command()
@click.argument('interfacename', required=False)
@multi_asic_util.multi_asic_click_option_namespace
@clicommon.pass_db
def expected(db, interfacename):
def expected(db, interfacename, namespace):
"""Show expected neighbor information by interfaces"""

neighbor_dict = db.cfgdb.get_table("DEVICE_NEIGHBOR")
if not namespace:
namespace = multi_asic_util.constants.DEFAULT_NAMESPACE

neighbor_dict = db.cfgdb_clients[namespace].get_table("DEVICE_NEIGHBOR")
if neighbor_dict is None:
click.echo("DEVICE_NEIGHBOR information is not present.")
return

neighbor_metadata_dict = db.cfgdb.get_table("DEVICE_NEIGHBOR_METADATA")
neighbor_metadata_dict = db.cfgdb_clients[namespace].get_table("DEVICE_NEIGHBOR_METADATA")
if neighbor_metadata_dict is None:
click.echo("DEVICE_NEIGHBOR_METADATA information is not present.")
return
Expand Down
Loading