From 07a6ef0fbab7a75ec4d6e3fbd84c569475d452bb Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 30 Sep 2018 16:35:57 -0400 Subject: [PATCH] Remove ability for client to set router secondary (must always set primary) --- cli-client/pvc.py | 17 ----------------- client-common/client_lib/router.py | 12 +----------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/cli-client/pvc.py b/cli-client/pvc.py index de45a026..68620282 100755 --- a/cli-client/pvc.py +++ b/cli-client/pvc.py @@ -158,22 +158,6 @@ def cli_router(): pass -############################################################################### -# pvc router secondary -############################################################################### -@click.command(name='secondary', short_help='Set a router in secondary status.') -@click.argument( - 'router' -) -def router_secondary(router): - """ - Take ROUTER out of primary mode handling gateways and into secondary mode. - """ - - zk_conn = pvc_common.startZKConnection(zk_host) - retcode, retmsg = pvc_router.secondary_router(zk_conn, router) - cleanup(retcode, retmsg, zk_conn) - ############################################################################### # pvc router primary ############################################################################### @@ -890,7 +874,6 @@ cli_node.add_command(node_unflush) cli_node.add_command(node_info) cli_node.add_command(node_list) -cli_router.add_command(router_secondary) cli_router.add_command(router_primary) cli_router.add_command(router_info) cli_router.add_command(router_list) diff --git a/client-common/client_lib/router.py b/client-common/client_lib/router.py index 389a66bb..d3241d85 100644 --- a/client-common/client_lib/router.py +++ b/client-common/client_lib/router.py @@ -86,15 +86,6 @@ def getInformationFromRouter(zk_conn, router_name, long_output): # # Direct Functions # -def secondary_router(zk_conn, router): - # Verify router is valid - if not common.verifyRouter(zk_conn, router): - return False, 'ERROR: No router named "{}" is present in the cluster.'.format(router) - - click.echo('Setting router {} in secondary mode.'.format(router)) - zkhandler.writedata(zk_conn, { '/routers/{}/networkstate'.format(router): 'secondary' }) - return True, '' - def primary_router(zk_conn, router): # Verify router is valid if not common.verifyRouter(zk_conn, router): @@ -102,8 +93,7 @@ def primary_router(zk_conn, router): click.echo('Setting router {} in primary mode.'.format(router)) zkhandler.writedata(zk_conn, { - '/routers': router, - '/routers/{}/networkstate'.format(router): 'primary' + '/routers': router }) return True, ''