Skip to content

Commit

Permalink
Config interface Loopback0 ip add/del is not working (#443)
Browse files Browse the repository at this point in the history
* Incremental addition/deletion of address on Loopback0 interface are not working.

Fix:
  - Check if add/remove are called on Loopback0 interface and pass them to config DB.
  • Loading branch information
kirankella authored and lguohan committed May 10, 2019
1 parent 430d4b8 commit c66315a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,9 @@ def add(ctx, interface_name, ip_addr):
config_db.set_entry("PORTCHANNEL_INTERFACE", (interface_name, ip_addr), {"NULL": "NULL"})
elif interface_name.startswith("Vlan"):
config_db.set_entry("VLAN_INTERFACE", (interface_name, ip_addr), {"NULL": "NULL"})
elif interface_name.startswith("Loopback"):
config_db.set_entry("LOOPBACK_INTERFACE", (interface_name, ip_addr), {"NULL": "NULL"})


#
# 'del' subcommand
Expand All @@ -975,6 +978,8 @@ def remove(ctx, interface_name, ip_addr):
config_db.set_entry("PORTCHANNEL_INTERFACE", (interface_name, ip_addr), None)
elif interface_name.startswith("Vlan"):
config_db.set_entry("VLAN_INTERFACE", (interface_name, ip_addr), None)
elif interface_name.startswith("Loopback"):
config_db.set_entry("LOOPBACK_INTERFACE", (interface_name, ip_addr), None)

#
# 'acl' group ('config acl ...')
Expand Down

0 comments on commit c66315a

Please sign in to comment.