Merge "Removing redundant wf_ex_id parameter for rerun across the code"

This commit is contained in:
Jenkins 2016-06-09 11:11:26 +00:00 committed by Gerrit Code Review
commit 88b399449b
3 changed files with 4 additions and 11 deletions

View File

@ -174,7 +174,6 @@ class TasksController(rest.RestController):
)
rpc.get_engine_client().rerun_workflow(
wf_ex.id,
task_ex.id,
reset=reset,
env=env

View File

@ -180,12 +180,10 @@ class EngineServer(object):
return self._engine.pause_workflow(execution_id)
def rerun_workflow(self, rpc_ctx, wf_ex_id, task_ex_id,
reset=True, env=None):
def rerun_workflow(self, rpc_ctx, task_ex_id, reset=True, env=None):
"""Receives calls over RPC to rerun workflows on engine.
:param rpc_ctx: RPC request context.
:param wf_ex_id: Workflow execution id.
:param task_ex_id: Task execution id.
:param reset: If true, then purge action execution for the task.
:param env: Environment variables to update.
@ -194,10 +192,10 @@ class EngineServer(object):
LOG.info(
"Received RPC request 'rerun_workflow'[rpc_ctx=%s, "
"wf_ex_id=%s, task_ex_id=%s]" % (rpc_ctx, wf_ex_id, task_ex_id)
"task_ex_id=%s]" % (rpc_ctx, task_ex_id)
)
return self._engine.rerun_workflow(wf_ex_id, task_ex_id, reset, env)
return self._engine.rerun_workflow(task_ex_id, reset, env)
def resume_workflow(self, rpc_ctx, wf_ex_id, env=None):
"""Receives calls over RPC to resume workflows on engine.
@ -385,13 +383,12 @@ class EngineClient(base.Engine):
)
@wrap_messaging_exception
def rerun_workflow(self, wf_ex_id, task_ex_id, reset=True, env=None):
def rerun_workflow(self, task_ex_id, reset=True, env=None):
"""Rerun the workflow.
This method reruns workflow with the given execution id
at the specific task execution id.
:param wf_ex_id: Workflow execution id.
:param task_ex_id: Task execution id.
:param reset: If true, then reset task execution state and purge
action execution for the task.
@ -402,7 +399,6 @@ class EngineClient(base.Engine):
return self._client.call(
auth_ctx.ctx(),
'rerun_workflow',
wf_ex_id=wf_ex_id,
task_ex_id=task_ex_id,
reset=reset,
env=env

View File

@ -184,7 +184,6 @@ class TestTasksController(base.APITest):
self.assertDictEqual(TASK, resp.json)
rpc.EngineClient.rerun_workflow.assert_called_with(
WF_EX.id,
TASK_EX.id,
reset=params['reset'],
env=None
@ -243,7 +242,6 @@ class TestTasksController(base.APITest):
self.assertDictEqual(TASK, resp.json)
rpc.EngineClient.rerun_workflow.assert_called_with(
WF_EX.id,
TASK_EX.id,
reset=params['reset'],
env=json.loads(params['env'])