Skip to content

Commit

Permalink
[config][vxlan] fix 'vxlan evpn_nvo add' command error (sonic-net#1511)
Browse files Browse the repository at this point in the history
* [config][vxlan]fix 'vxlan evpn_nvo add' command error
Remove extra 'CONFIG_DB' argument from db.cfgdb.get_keys()
Signed-off-by: shikenghua <kh_shi@edge-core.com>
  • Loading branch information
shikenghua authored May 10, 2021
1 parent 331c5a5 commit fde1d95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/vxlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions tests/vxlan_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fde1d95

Please sign in to comment.