Skip to content

Commit

Permalink
fix order
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelmsft committed Sep 16, 2022
1 parent e24f7d8 commit c52e8cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,8 @@ def add_portchannel(ctx, portchannel_name, min_links, fallback, fast_rate):
def remove_portchannel(ctx, portchannel_name):
"""Remove port channel"""

db = ValidatedConfigDBConnector(ctx.obj['db'], ADHOC_VALIDATION)

if ADHOC_VALIDATION:
if is_portchannel_name_valid(portchannel_name) != True:
ctx.fail("{} is invalid!, name should have prefix '{}' and suffix'{}'"
Expand All @@ -2076,8 +2078,6 @@ def remove_portchannel(ctx, portchannel_name):
if is_portchannel_present_in_db(db, portchannel_name) is False:
ctx.fail("{} is not present.".format(portchannel_name))

db = ValidatedConfigDBConnector(ctx.obj['db'], ADHOC_VALIDATION)

# Dont let to remove port channel if vlan membership exists
for k,v in db.get_table('VLAN_MEMBER'):
if v == portchannel_name:
Expand Down

0 comments on commit c52e8cc

Please sign in to comment.