Actually send wait for unflush

This commit is contained in:
Joshua Boniface 2019-05-11 00:16:38 -04:00
parent 62a71af46e
commit 91ea96b772
2 changed files with 13 additions and 5 deletions

View File

@ -124,26 +124,34 @@ def node_flush(node, wait):
@click.argument(
'node', default=myhostname
)
def node_ready(node):
@click.option(
'-w', '--wait', 'wait', is_flag=True, default=False,
help='Wait for migrations to complete before returning.'
)
def node_ready(node, wait):
"""
Restore NODE to active service and migrate back all VMs. If unspecified, defaults to this host.
"""
zk_conn = pvc_common.startZKConnection(zk_host)
retcode, retmsg = pvc_node.ready_node(zk_conn, node)
retcode, retmsg = pvc_node.ready_node(zk_conn, node, wait)
cleanup(retcode, retmsg, zk_conn)
@click.command(name='unflush', short_help='Restore node to service.')
@click.argument(
'node', default=myhostname
)
def node_unflush(node):
@click.option(
'-w', '--wait', 'wait', is_flag=True, default=False,
help='Wait for migrations to complete before returning.'
)
def node_unflush(node, wait):
"""
Restore NODE to active service and migrate back all VMs. If unspecified, defaults to this host.
"""
zk_conn = pvc_common.startZKConnection(zk_host)
retcode, retmsg = pvc_node.ready_node(zk_conn, node)
retcode, retmsg = pvc_node.ready_node(zk_conn, node, wait)
cleanup(retcode, retmsg, zk_conn)
###############################################################################

View File

@ -164,7 +164,7 @@ def flush_node(zk_conn, node, wait):
return True, retmsg
def ready_node(zk_conn, node):
def ready_node(zk_conn, node, wait):
# Verify node is valid
if not common.verifyNode(zk_conn, node):
return False, 'ERROR: No node named "{}" is present in the cluster.'.format(node)