Skip to content

Commit fde1d95

Browse files
authored
[config][vxlan] fix 'vxlan evpn_nvo add' command error (sonic-net#1511)
* [config][vxlan]fix 'vxlan evpn_nvo add' command error Remove extra 'CONFIG_DB' argument from db.cfgdb.get_keys() Signed-off-by: shikenghua <[email protected]>
1 parent 331c5a5 commit fde1d95

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config/vxlan.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def del_vxlan(db, vxlan_name):
4747
if(vxlan_count > 0):
4848
ctx.fail("Please delete the EVPN NVO configuration.")
4949

50-
vxlan_keys = db.cfgdb.get_keys('CONFIG_DB', "VXLAN_TUNNEL_MAP|*")
50+
vxlan_keys = db.cfgdb.get_keys("VXLAN_TUNNEL_MAP|*")
5151
if not vxlan_keys:
5252
vxlan_count = 0
5353
else:
@@ -69,7 +69,7 @@ def vxlan_evpn_nvo():
6969
def add_vxlan_evpn_nvo(db, nvo_name, vxlan_name):
7070
"""Add NVO"""
7171
ctx = click.get_current_context()
72-
vxlan_keys = db.cfgdb.get_keys('CONFIG_DB', "VXLAN_EVPN_NVO|*")
72+
vxlan_keys = db.cfgdb.get_keys("VXLAN_EVPN_NVO|*")
7373
if not vxlan_keys:
7474
vxlan_count = 0
7575
else:

tests/vxlan_test.py

+5
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ def test_config_vxlan_add(self):
215215
print(result.output)
216216
assert result.exit_code == 0
217217

218+
result = runner.invoke(config.config.commands["vxlan"].commands["evpn_nvo"].commands["add"], ["nvo1", "vtep1"], obj=db)
219+
print(result.exit_code)
220+
print(result.output)
221+
assert result.exit_code == 0
222+
218223
result = runner.invoke(show.cli.commands["vxlan"].commands["interface"], [])
219224
print(result.exit_code)
220225
print(result.output)

0 commit comments

Comments
 (0)