From a4bdc7c3ffcf506e9e9e21c015424c511bf37a98 Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Wed, 20 Sep 2017 21:09:09 +0300 Subject: [PATCH] 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 --- .../openstack/scenarios/mistral/executions.py | 4 ++-- rally/plugins/openstack/validators.py | 12 ++++++------ tests/unit/plugins/openstack/test_validators.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rally/plugins/openstack/scenarios/mistral/executions.py b/rally/plugins/openstack/scenarios/mistral/executions.py index bf4ad27d..5c9a400b 100644 --- a/rally/plugins/openstack/scenarios/mistral/executions.py +++ b/rally/plugins/openstack/scenarios/mistral/executions.py @@ -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") diff --git a/rally/plugins/openstack/validators.py b/rally/plugins/openstack/validators.py index a1b3cbe8..ccbf2091 100644 --- a/rally/plugins/openstack/validators.py +++ b/rally/plugins/openstack/validators.py @@ -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) diff --git a/tests/unit/plugins/openstack/test_validators.py b/tests/unit/plugins/openstack/test_validators.py index 0a291be5..bddc8efc 100644 --- a/tests/unit/plugins/openstack/test_validators.py +++ b/tests/unit/plugins/openstack/test_validators.py @@ -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": {