Rename arguments of workbook_contains_workflow validator
Both arguments of workbook_contains_workflow validator are parameters of scenarios. To simplify readability, let's use "_param" suffix for both arguments. There is no need for backward compatibility things since the new validator had been created recenly and was not released yet. The old validator continure uses old terminology. Change-Id: I73a17a55a4f6df385b3dc9677cef9624872d550b
This commit is contained in:
parent
f06f549dd6
commit
a4bdc7c3ff
@ -59,8 +59,8 @@ class ListExecutions(utils.MistralScenario):
|
||||
@validation.add("required_services",
|
||||
services=[consts.Service.MISTRAL])
|
||||
@validation.add("workbook_contains_workflow",
|
||||
param_name="definition",
|
||||
workflow_name="workflow_name")
|
||||
workbook_param="definition",
|
||||
workflow_param="workflow_name")
|
||||
@scenario.configure(name="MistralExecutions.create_execution_from_workbook",
|
||||
context={"cleanup@openstack": ["mistral"]},
|
||||
platform="openstack")
|
||||
|
@ -562,15 +562,15 @@ class VolumeTypeExistsValidator(validation.Validator):
|
||||
@validation.configure(name="workbook_contains_workflow", platform="openstack")
|
||||
class WorkbookContainsWorkflowValidator(validators.FileExistsValidator):
|
||||
|
||||
def __init__(self, param_name, workflow_name):
|
||||
def __init__(self, workbook_param, workflow_param):
|
||||
"""Validate that workflow exist in workbook when workflow is passed
|
||||
|
||||
:param param_name: parameter containing the workbook definition
|
||||
:param workflow_name: parameter containing the workflow name
|
||||
:param workbook_param: parameter containing the workbook definition
|
||||
:param workflow_param: parameter containing the workflow name
|
||||
"""
|
||||
super(WorkbookContainsWorkflowValidator, self).__init__(workflow_name)
|
||||
self.workbook = param_name
|
||||
self.workflow = workflow_name
|
||||
super(WorkbookContainsWorkflowValidator, self).__init__(workflow_param)
|
||||
self.workbook = workbook_param
|
||||
self.workflow = workflow_param
|
||||
|
||||
def validate(self, config, credentials, plugin_cls, plugin_cfg):
|
||||
wf_name = config.get("args", {}).get(self.workflow)
|
||||
|
@ -954,7 +954,7 @@ class WorkbookContainsWorkflowValidatorTestCase(test.TestCase):
|
||||
}
|
||||
}
|
||||
validator = validators.WorkbookContainsWorkflowValidator(
|
||||
param_name="definition", workflow_name="workflow_name")
|
||||
workbook_param="definition", workflow_param="workflow_name")
|
||||
|
||||
context = {
|
||||
"args": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user