From 2ca7c63569bcd05a7688f7ecbfd858b3637e01c2 Mon Sep 17 00:00:00 2001 From: Prince Sunny Date: Wed, 30 Jan 2019 13:35:02 -0800 Subject: [PATCH] Revert "[config/main.py]Fixed - added a validation such that delete portchannel or portchannel members only when it is configured (#277) (#445)" (#452) This reverts commit dc5d5c4a52b2b61d43d6f2ce65996d60057f2d70. --- config/main.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/config/main.py b/config/main.py index a428353199..1cd172c051 100755 --- a/config/main.py +++ b/config/main.py @@ -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 @@ -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 ...')