diff --git a/rally-jobs/rally-watcher.yaml b/rally-jobs/rally-watcher.yaml index b0f5e5eb..3ccdf3a8 100644 --- a/rally-jobs/rally-watcher.yaml +++ b/rally-jobs/rally-watcher.yaml @@ -17,7 +17,6 @@ name: "dummy" strategy: name: "dummy" - extra: {} sla: failure_rate: max: 0 @@ -29,7 +28,6 @@ name: "dummy" strategy: name: "dummy" - extra: {} runner: type: "constant" times: 10 @@ -56,12 +54,10 @@ name: "workload_balancing" strategy: name: "workload_stabilization" - extra: {} - goal: name: "dummy" strategy: name: "dummy" - extra: {} sla: failure_rate: max: 0 \ No newline at end of file diff --git a/rally/plugins/openstack/context/watcher/audit_templates.py b/rally/plugins/openstack/context/watcher/audit_templates.py index a9cbb45d..5cd26d29 100644 --- a/rally/plugins/openstack/context/watcher/audit_templates.py +++ b/rally/plugins/openstack/context/watcher/audit_templates.py @@ -60,9 +60,6 @@ class AuditTemplateGenerator(context.Context): } } }, - "extra": { - "type": "object" - }, }, }, }, @@ -100,10 +97,9 @@ class AuditTemplateGenerator(context.Context): strategy_id = types.WatcherStrategy.transform( clients=clients, resource_config=audit_params["strategy"]) - extra = audit_params.get("extra") or {} audit_template = watcher_scenario._create_audit_template( - goal_id, strategy_id, extra) + goal_id, strategy_id) self.context["audit_templates"].append(audit_template.uuid) @logging.log_task_wrapper(LOG.info, _("Exit context: `Audit Templates`")) diff --git a/rally/plugins/openstack/scenarios/watcher/basic.py b/rally/plugins/openstack/scenarios/watcher/basic.py index c1d92bb0..376a7263 100644 --- a/rally/plugins/openstack/scenarios/watcher/basic.py +++ b/rally/plugins/openstack/scenarios/watcher/basic.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from rally.common import logging from rally import consts from rally.plugins.openstack import scenario from rally.plugins.openstack.scenarios.watcher import utils @@ -28,18 +29,18 @@ from rally.task import validation name="Watcher.create_audit_template_and_delete") class CreateAuditTemplateAndDelete(utils.WatcherScenario): - def run(self, goal, strategy, extra=None): + @logging.log_deprecated_args("Extra field has been removed " + "since it isn't used.", "0.8.0", ["extra"], + once=True) + def run(self, goal, strategy): """Create audit template and delete it. :param goal: The goal audit template is based on :param strategy: The strategy used to provide resource optimization algorithm - :param extra: This field is used to specify some audit template - options """ - extra = extra or {} - audit_template = self._create_audit_template(goal, strategy, extra) + audit_template = self._create_audit_template(goal, strategy) self._delete_audit_template(audit_template.uuid) diff --git a/rally/plugins/openstack/scenarios/watcher/utils.py b/rally/plugins/openstack/scenarios/watcher/utils.py index 3f56595d..a36c0320 100644 --- a/rally/plugins/openstack/scenarios/watcher/utils.py +++ b/rally/plugins/openstack/scenarios/watcher/utils.py @@ -34,19 +34,17 @@ class WatcherScenario(scenario.OpenStackScenario): """Base class for Watcher scenarios with basic atomic actions.""" @atomic.action_timer("watcher.create_audit_template") - def _create_audit_template(self, goal_id, strategy_id, extra): + def _create_audit_template(self, goal_id, strategy_id): """Create Audit Template in DB :param goal_id: UUID Goal :param strategy_id: UUID Strategy - :param extra: Audit Template Extra (JSON Dict) :return: Audit Template object """ return self.admin_clients("watcher").audit_template.create( goal=goal_id, strategy=strategy_id, - name=self.generate_random_name(), - extra=extra or {}) + name=self.generate_random_name()) @atomic.action_timer("watcher.delete_audit_template") def _delete_audit_template(self, audit_template): diff --git a/samples/tasks/scenarios/watcher/create-audit-and-delete.json b/samples/tasks/scenarios/watcher/create-audit-and-delete.json index 37b66cb3..c6814409 100644 --- a/samples/tasks/scenarios/watcher/create-audit-and-delete.json +++ b/samples/tasks/scenarios/watcher/create-audit-and-delete.json @@ -21,8 +21,7 @@ }, "strategy": { "name": "dummy" - }, - "extra": {} + } } ] } diff --git a/samples/tasks/scenarios/watcher/create-audit-and-delete.yaml b/samples/tasks/scenarios/watcher/create-audit-and-delete.yaml index 9f845803..70fb65c7 100644 --- a/samples/tasks/scenarios/watcher/create-audit-and-delete.yaml +++ b/samples/tasks/scenarios/watcher/create-audit-and-delete.yaml @@ -17,4 +17,3 @@ name: "dummy" strategy: name: "dummy" - extra: {} diff --git a/samples/tasks/scenarios/watcher/create-audit-template-and-delete.json b/samples/tasks/scenarios/watcher/create-audit-template-and-delete.json index ad764fc9..1af665d2 100644 --- a/samples/tasks/scenarios/watcher/create-audit-template-and-delete.json +++ b/samples/tasks/scenarios/watcher/create-audit-template-and-delete.json @@ -7,8 +7,7 @@ }, "strategy": { "name": "dummy" - }, - "extra": {} + } }, "runner": { "type": "constant", diff --git a/samples/tasks/scenarios/watcher/create-audit-template-and-delete.yaml b/samples/tasks/scenarios/watcher/create-audit-template-and-delete.yaml index fa19c179..f51334ab 100644 --- a/samples/tasks/scenarios/watcher/create-audit-template-and-delete.yaml +++ b/samples/tasks/scenarios/watcher/create-audit-template-and-delete.yaml @@ -6,7 +6,6 @@ name: "dummy" strategy: name: "dummy" - extra: {} runner: type: "constant" times: 10 diff --git a/samples/tasks/scenarios/watcher/list-audit-templates.json b/samples/tasks/scenarios/watcher/list-audit-templates.json index 4198c502..122b1da1 100644 --- a/samples/tasks/scenarios/watcher/list-audit-templates.json +++ b/samples/tasks/scenarios/watcher/list-audit-templates.json @@ -17,8 +17,7 @@ }, "strategy": { "name": "workload_stabilization" - }, - "extra": {} + } }, { "goal": { @@ -26,8 +25,7 @@ }, "strategy": { "name": "dummy" - }, - "extra": {} + } } ] } diff --git a/samples/tasks/scenarios/watcher/list-audit-templates.yaml b/samples/tasks/scenarios/watcher/list-audit-templates.yaml index 6728f6d0..9174b081 100644 --- a/samples/tasks/scenarios/watcher/list-audit-templates.yaml +++ b/samples/tasks/scenarios/watcher/list-audit-templates.yaml @@ -14,9 +14,7 @@ name: "workload_balancing" strategy: name: "workload_stabilization" - extra: {} - goal: name: "dummy" strategy: name: "dummy" - extra: {} diff --git a/tests/unit/plugins/openstack/context/watcher/test_audit_templates.py b/tests/unit/plugins/openstack/context/watcher/test_audit_templates.py index b3043fbc..31b95421 100644 --- a/tests/unit/plugins/openstack/context/watcher/test_audit_templates.py +++ b/tests/unit/plugins/openstack/context/watcher/test_audit_templates.py @@ -51,8 +51,7 @@ class AuditTemplateTestCase(test.ScenarioTestCase): }, "strategy": { "name": "workload_stabilization" - }, - "extra": {} + } }, { "goal": { @@ -60,8 +59,7 @@ class AuditTemplateTestCase(test.ScenarioTestCase): }, "strategy": { "name": "workload_stabilization" - }, - "extra": {} + } } ] }, @@ -75,7 +73,7 @@ class AuditTemplateTestCase(test.ScenarioTestCase): audit_template.setup() goal_id = mock_watcher_goal_transform.return_value strategy_id = mock_watcher_strategy_transform.return_value - mock_calls = [mock.call(goal_id, strategy_id, {})] + mock_calls = [mock.call(goal_id, strategy_id)] mock_watcher_scenario__create_audit_template.assert_has_calls( mock_calls) diff --git a/tests/unit/plugins/openstack/scenarios/watcher/test_basic.py b/tests/unit/plugins/openstack/scenarios/watcher/test_basic.py index ce731b7f..a83b6dfb 100644 --- a/tests/unit/plugins/openstack/scenarios/watcher/test_basic.py +++ b/tests/unit/plugins/openstack/scenarios/watcher/test_basic.py @@ -27,10 +27,9 @@ class WatcherTestCase(test.ScenarioTestCase): scenario._create_audit_template = mock.MagicMock( return_value=audit_template) scenario._delete_audit_template = mock.MagicMock() - scenario.run("goal", "strategy", {}) + scenario.run("goal", "strategy") scenario._create_audit_template.assert_called_once_with("goal", - "strategy", - {}) + "strategy") scenario._delete_audit_template.assert_called_once_with( audit_template.uuid) diff --git a/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py b/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py index afb54f45..59de2763 100644 --- a/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py @@ -28,12 +28,11 @@ class WatcherScenarioTestCase(test.ScenarioTestCase): watcher_scenario = utils.WatcherScenario(self.context) watcher_scenario.generate_random_name = mock.MagicMock( return_value="mock_name") - watcher_scenario._create_audit_template("fake_goal", "fake_strategy", - {}) + watcher_scenario._create_audit_template("fake_goal", "fake_strategy") self.admin_clients( "watcher").audit_template.create.assert_called_once_with( goal="fake_goal", strategy="fake_strategy", - name="mock_name", extra={}) + name="mock_name") self._test_atomic_action_timer(watcher_scenario.atomic_actions(), "watcher.create_audit_template")