Rename task_id to task_execution_id

The previous name isn't consistent and it is confusing, tasks don't have
an ID, but the execution for a task does.

Related-Bug: #1718353
Change-Id: I049cf7312c58d83e9405aaa36a6961cca006cb16
This commit is contained in:
Dougal Matthews 2017-10-18 15:51:19 +01:00
parent e195c6d90f
commit 40e593bd20
3 changed files with 25 additions and 4 deletions

View File

@ -80,11 +80,27 @@ class SecurityContext(object):
class ExecutionContext(object):
def __init__(self, workflow_execution_id=None, task_id=None,
def __init__(self, workflow_execution_id=None, task_execution_id=None,
action_execution_id=None, workflow_name=None,
callback_url=None):
callback_url=None, task_id=None):
self.workflow_execution_id = workflow_execution_id
self.task_id = task_id
self.task_execution_id = task_execution_id
self.action_execution_id = action_execution_id
self.workflow_name = workflow_name
self.callback_url = callback_url
if task_id is not None:
self.task_execution_id = task_id
self._deprecate_task_id_warning()
def _deprecate_task_id_warning(self):
warnings.warn(
"context.execution.task_id was deprecated in the Queens cycle. "
"Please use context.execution.task_execution_id. It will be "
"removed in a future release.", DeprecationWarning
)
@property
def task_id(self):
self._deprecate_task_id_warning()
return self.task_execution_id

View File

@ -30,7 +30,7 @@ def _fake_context():
execution_ctx = context.ExecutionContext(
workflow_execution_id='workflow_execution_id',
task_id='task_id',
task_execution_id='task_execution_id',
action_execution_id='action_execution_id',
workflow_name='workflow_name',
callback_url='callback_url')

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The attribute `context.execution.task_id` has been renamed to
`context.execution.task_execution_id`.