Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ def cli_sroute_to_config(ctx, command_str, strict_nh = True):
elif 'prefix' in prefix_str:
# prefix_str: ['prefix', ip]
ip_prefix = prefix_str[1]
vrf_name = "default"
else:
ctx.fail("prefix is not in pattern!")

Expand Down Expand Up @@ -5314,7 +5315,7 @@ def add_route(ctx, command_str):

# Check if exist entry with key
keys = config_db.get_keys('STATIC_ROUTE')
if key in keys:
if tuple(key.split("|")) in keys:
# If exist update current entry
current_entry = config_db.get_entry('STATIC_ROUTE', key)

Expand All @@ -5339,7 +5340,7 @@ def del_route(ctx, command_str):
key, route = cli_sroute_to_config(ctx, command_str, strict_nh=False)
keys = config_db.get_keys('STATIC_ROUTE')
prefix_tuple = tuple(key.split('|'))
if not key in keys and not prefix_tuple in keys:
if not tuple(key.split("|")) in keys and not prefix_tuple in keys:
ctx.fail('Route {} doesnt exist'.format(key))
else:
# If not defined nexthop or intf name remove entire route
Expand Down
Loading