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).
This commit is contained in:
Joshua Boniface 2020-01-26 23:04:52 -05:00
parent 0892e4c842
commit 27e73fc6a9
2 changed files with 3 additions and 3 deletions

View File

@ -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/<node>/domain-state')

View File

@ -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)