Add wait functionality to API domain-state

This commit is contained in:
2019-12-25 20:22:00 -05:00
parent b1c19a21ba
commit e8d8fb161b
2 changed files with 12 additions and 7 deletions

View File

@ -201,12 +201,12 @@ def node_primary(node):
}
return output, retcode
def node_flush(node):
def node_flush(node, wait):
"""
Flush NODE of running VMs.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_node.flush_node(zk_conn, node, False)
retflag, retdata = pvc_node.flush_node(zk_conn, node, wait)
if retflag:
retcode = 200
else:
@ -218,12 +218,12 @@ def node_flush(node):
}
return output, retcode
def node_ready(node):
def node_ready(node, wait):
"""
Restore NODE to active service.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_node.ready_node(zk_conn, node)
retflag, retdata = pvc_node.ready_node(zk_conn, node, wait)
if retflag:
retcode = 200
else: