Skip to content

Commit

Permalink
Revert "[config/main.py]Fixed - added a validation such that delete p…
Browse files Browse the repository at this point in the history
…ortchannel or portchannel members only when it is configured (sonic-net#277) (sonic-net#445)" (sonic-net#452)

This reverts commit dc5d5c4.
  • Loading branch information
prsunny authored Jan 30, 2019
1 parent dc5d5c4 commit 2ca7c63
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,7 @@ def add_portchannel(ctx, portchannel_name, min_links, fallback):
def remove_portchannel(ctx, portchannel_name):
"""Remove port channel"""
db = ctx.obj['db']
if len(db.get_entry('PORTCHANNEL', portchannel_name)) != 0:
db.set_entry('PORTCHANNEL', portchannel_name, None)
else:
ctx.fail("{} is not configured".format(portchannel_name))

db.set_entry('PORTCHANNEL', portchannel_name, None)

@portchannel.group('member')
@click.pass_context
Expand All @@ -492,11 +488,9 @@ def add_portchannel_member(ctx, portchannel_name, port_name):
def del_portchannel_member(ctx, portchannel_name, port_name):
"""Remove member from portchannel"""
db = ctx.obj['db']
if len(db.get_entry('PORTCHANNEL_MEMBER', portchannel_name + '|' + port_namee)) != 0:
db.set_entry('PORTCHANNEL_MEMBER', (portchannel_name, port_name), None)
db.set_entry('PORTCHANNEL_MEMBER', portchannel_name + '|' + port_name, None)
else:
ctx.fail("{} is not part of {}".format(port_name, portchannel_name))
db.set_entry('PORTCHANNEL_MEMBER', (portchannel_name, port_name), None)
db.set_entry('PORTCHANNEL_MEMBER', portchannel_name + '|' + port_name, None)


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

0 comments on commit 2ca7c63

Please sign in to comment.