diff --git a/doc/Command-Reference.md b/doc/Command-Reference.md index cf9abeeaf0..037b6f980e 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -5435,7 +5435,7 @@ This command is used to display the list of expected neighbors for all interface - Usage: ``` - show interfaces neighbor expected [] + show interfaces neighbor expected [] -n [] ``` - Example: diff --git a/show/interfaces/__init__.py b/show/interfaces/__init__.py index 69198b0aa8..0da766406a 100644 --- a/show/interfaces/__init__.py +++ b/show/interfaces/__init__.py @@ -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