Merge "Fix force parameter being always added to URL in execution delete"

This commit is contained in:
Zuul 2018-06-07 22:10:31 +00:00 committed by Gerrit Code Review
commit 7451abb848
4 changed files with 15 additions and 4 deletions

View File

@ -117,7 +117,8 @@ class ExecutionManager(base.ResourceManager):
self._ensure_not_empty(id=id)
qparams = {}
qparams['force'] = bool(force)
if force:
qparams['force'] = True
query_string = ("?%s" % urlparse.urlencode(list(qparams.items()))
if qparams else "")

View File

@ -245,7 +245,7 @@ class MistralClientTestBase(base.MistralCLIAuth, base.MistralCLIAltAuth):
self.mistral_cli,
admin,
'execution-delete',
params=exec_id
params="{} --force".format(exec_id)
)
return ex

View File

@ -660,7 +660,8 @@ class ExecutionCLITests(base_v2.MistralClientTestBase):
self.assertIn(wf_name, [ex['Workflow name'] for ex in execs])
self.assertIn(namespace, [ex['Workflow namespace'] for ex in execs])
self.mistral_admin('execution-delete', params=exec_id)
params = "{} --force".format(exec_id)
self.mistral_admin('execution-delete', params=params)
def test_execution_create_delete(self):
@ -688,7 +689,8 @@ class ExecutionCLITests(base_v2.MistralClientTestBase):
self.assertIn(exec_id, [ex['ID'] for ex in execs])
self.assertIn(wf_name, [ex['Workflow name'] for ex in execs])
self.mistral_admin('execution-delete', params=exec_id)
params = "{} --force".format(exec_id)
self.mistral_admin('execution-delete', params=params)
def test_execution_create_with_input_and_start_task(self):
execution = self.execution_create(

View File

@ -0,0 +1,8 @@
---
fixes:
- |
mistralclient 3.5.0 introduced a new --force option to delete executions
that are still running. However, this had the unintended impact of passing
force=false when it wasn't provided. This is incompatible with previous
releases of the Mistral API which reject requests as they don't recognise
"force".