Implement wait for node coordinator transition

References #72
This commit is contained in:
2020-02-19 10:33:22 -05:00
parent 6db4df51c0
commit 0aefafa7f7
5 changed files with 48 additions and 15 deletions

View File

@ -213,12 +213,12 @@ def node_domain_state(node):
return retdata, retcode
def node_secondary(node):
def node_secondary(node, wait):
"""
Take NODE out of primary router mode.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_node.secondary_node(zk_conn, node)
retflag, retdata = pvc_node.secondary_node(zk_conn, node, wait)
pvc_common.stopZKConnection(zk_conn)
if retflag:
@ -231,12 +231,12 @@ def node_secondary(node):
}
return output, retcode
def node_primary(node):
def node_primary(node, wait):
"""
Set NODE to primary router mode.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_node.primary_node(zk_conn, node)
retflag, retdata = pvc_node.primary_node(zk_conn, node, wait)
pvc_common.stopZKConnection(zk_conn)
if retflag: