From 91ea96b7727ca213145a1ba7ff1692e42b419032 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 11 May 2019 00:16:38 -0400 Subject: [PATCH] Actually send wait for unflush --- client-cli/pvc.py | 16 ++++++++++++---- client-common/node.py | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client-cli/pvc.py b/client-cli/pvc.py index c63cf4ef..bf9a3963 100755 --- a/client-cli/pvc.py +++ b/client-cli/pvc.py @@ -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) ############################################################################### diff --git a/client-common/node.py b/client-common/node.py index cdd8cf19..e0d8c3c2 100644 --- a/client-common/node.py +++ b/client-common/node.py @@ -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)