From 27e73fc6a9066e188171e0f3afe8e0db2f8df395 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Jan 2020 23:04:52 -0500 Subject: [PATCH] Fix issues with wait on node flush/ready Ensure that the strings are converted to booleans on the API side, and that we're sending a lowercase true/false (for consistency). --- client-api/pvc-api.py | 4 ++-- client-cli/cli_lib/node.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client-api/pvc-api.py b/client-api/pvc-api.py index b2d07c1b..81578acf 100755 --- a/client-api/pvc-api.py +++ b/client-api/pvc-api.py @@ -710,9 +710,9 @@ class API_Node_DomainState(Resource): id: Message """ if reqargs['state'] == 'flush': - return api_helper.node_flush(node, reqargs.get('wait', False)) + return api_helper.node_flush(node, strtobool(reqargs.get('wait', 'false'))) if reqargs['state'] == 'ready': - return api_helper.node_ready(node, reqargs.get('wait', False)) + return api_helper.node_ready(node, strtobool(reqargs.get('wait', 'false'))) abort(400) api.add_resource(API_Node_DomainState, '/node//domain-state') diff --git a/client-cli/cli_lib/node.py b/client-cli/cli_lib/node.py index ded77c63..7f63841b 100644 --- a/client-cli/cli_lib/node.py +++ b/client-cli/cli_lib/node.py @@ -56,7 +56,7 @@ def node_domain_state(config, node, action, wait): """ params={ 'state': action, - 'wait': wait + 'wait': str(wait).lower() } response = call_api(config, 'post', '/node/{node}/domain-state'.format(node=node), params=params)