From fde1d95549468545fe4477a9f21b955848cc72d7 Mon Sep 17 00:00:00 2001 From: shikenghua Date: Tue, 11 May 2021 07:55:26 +0800 Subject: [PATCH] [config][vxlan] fix 'vxlan evpn_nvo add' command error (#1511) * [config][vxlan]fix 'vxlan evpn_nvo add' command error Remove extra 'CONFIG_DB' argument from db.cfgdb.get_keys() Signed-off-by: shikenghua --- config/vxlan.py | 4 ++-- tests/vxlan_test.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/vxlan.py b/config/vxlan.py index 382ab72815e7..bfda1f4effb1 100644 --- a/config/vxlan.py +++ b/config/vxlan.py @@ -47,7 +47,7 @@ def del_vxlan(db, vxlan_name): if(vxlan_count > 0): ctx.fail("Please delete the EVPN NVO configuration.") - vxlan_keys = db.cfgdb.get_keys('CONFIG_DB', "VXLAN_TUNNEL_MAP|*") + vxlan_keys = db.cfgdb.get_keys("VXLAN_TUNNEL_MAP|*") if not vxlan_keys: vxlan_count = 0 else: @@ -69,7 +69,7 @@ def vxlan_evpn_nvo(): def add_vxlan_evpn_nvo(db, nvo_name, vxlan_name): """Add NVO""" ctx = click.get_current_context() - vxlan_keys = db.cfgdb.get_keys('CONFIG_DB', "VXLAN_EVPN_NVO|*") + vxlan_keys = db.cfgdb.get_keys("VXLAN_EVPN_NVO|*") if not vxlan_keys: vxlan_count = 0 else: diff --git a/tests/vxlan_test.py b/tests/vxlan_test.py index 74819f9f6179..b0997c5ee044 100644 --- a/tests/vxlan_test.py +++ b/tests/vxlan_test.py @@ -215,6 +215,11 @@ def test_config_vxlan_add(self): print(result.output) assert result.exit_code == 0 + result = runner.invoke(config.config.commands["vxlan"].commands["evpn_nvo"].commands["add"], ["nvo1", "vtep1"], obj=db) + print(result.exit_code) + print(result.output) + assert result.exit_code == 0 + result = runner.invoke(show.cli.commands["vxlan"].commands["interface"], []) print(result.exit_code) print(result.output)