From da8614e6089d49108ab02317ab0af903fbbb2872 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Tue, 20 Dec 2016 14:53:47 +0100 Subject: [PATCH] Set alerting_mode only for 0.x plugins This parameter has been removed starting with 1.0. Change-Id: I26daa01ee9cc10dbd139f5f3a7f8f5aa55e6a76b --- stacklight_tests/lma_collector/plugin_settings.py | 8 ++++++-- .../toolchain/test_dedicated_environment.py | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/stacklight_tests/lma_collector/plugin_settings.py b/stacklight_tests/lma_collector/plugin_settings.py index dbf4fd9..86f5b15 100644 --- a/stacklight_tests/lma_collector/plugin_settings.py +++ b/stacklight_tests/lma_collector/plugin_settings.py @@ -26,14 +26,18 @@ default_options = { "environment_label/value": "deploy_lma_toolchain", "elasticsearch_mode/value": "remote", "influxdb_mode/value": "remote", - "alerting_mode/value": "local", "elasticsearch_address/value": "127.0.0.1", "influxdb_address/value": "127.0.0.1" } +if version.startswith("0."): + # Only 0.x versions expose the alerting_mode parameter + default_options["alerting_mode/value"] = "local" toolchain_options = { "environment_label/value": "deploy_lma_toolchain", "elasticsearch_mode/value": "local", "influxdb_mode/value": "local", - "alerting_mode/value": "local" } +if version.startswith("0."): + # Only 0.x versions expose the alerting_mode parameter + toolchain_options["alerting_mode/value"] = "local" diff --git a/stacklight_tests/toolchain/test_dedicated_environment.py b/stacklight_tests/toolchain/test_dedicated_environment.py index 3f7b8ea..82b61cd 100644 --- a/stacklight_tests/toolchain/test_dedicated_environment.py +++ b/stacklight_tests/toolchain/test_dedicated_environment.py @@ -132,7 +132,7 @@ class TestToolchainDedicatedEnvironment(api.ToolchainApi): ) logger.info("New cluster id: {}".format(self.helpers.cluster_id)) - self.LMA_COLLECTOR.activate_plugin(options={ + options = { "environment_label/value": "deploy_env_using_standalone_backends", "elasticsearch_mode/value": "remote", "elasticsearch_address/value": elasticsearch_ip, @@ -141,8 +141,12 @@ class TestToolchainDedicatedEnvironment(api.ToolchainApi): "influxdb_database/value": "lma", "influxdb_user/value": influxdb_settings.influxdb_user, "influxdb_password/value": influxdb_settings.influxdb_pass, - "alerting_mode/value": "local" - }) + } + if self.LMA_COLLECTOR.settings.version.startswith("0."): + # Only 0.x versions expose the alerting_mode parameter + options["alerting_mode/value"] = "local" + + self.LMA_COLLECTOR.activate_plugin(options=options) self.disable_plugin(self.ELASTICSEARCH_KIBANA) self.disable_plugin(self.INFLUXDB_GRAFANA) self.disable_plugin(self.LMA_INFRASTRUCTURE_ALERTING)