Avoid hardcoding version numbers in the settings
The version number can be extracted from the package's filename. Change-Id: I0fd3cf86a3a299898027b5e6be07c6ec47e0271c
This commit is contained in:
@@ -12,11 +12,12 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from stacklight_tests.helpers import helpers
|
||||||
from stacklight_tests import settings
|
from stacklight_tests import settings
|
||||||
|
|
||||||
|
|
||||||
name = 'elasticsearch_kibana'
|
name = 'elasticsearch_kibana'
|
||||||
version = '0.9.0'
|
|
||||||
role_name = ['elasticsearch_kibana']
|
role_name = ['elasticsearch_kibana']
|
||||||
vip_name = 'es_vip_mgmt'
|
vip_name = 'es_vip_mgmt'
|
||||||
plugin_path = settings.ELASTICSEARCH_KIBANA_PLUGIN_PATH
|
plugin_path = settings.ELASTICSEARCH_KIBANA_PLUGIN_PATH
|
||||||
|
version = helpers.get_plugin_version(plugin_path)
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
@@ -23,12 +24,30 @@ from proboscis import asserts
|
|||||||
from stacklight_tests import settings
|
from stacklight_tests import settings
|
||||||
|
|
||||||
|
|
||||||
|
PACKAGE_VERSION_RE = re.compile(r'(\d+\.\d+\.\d+)')
|
||||||
|
|
||||||
|
|
||||||
def create_cluster(
|
def create_cluster(
|
||||||
env, name, cluster_settings=None, mode=settings.DEPLOYMENT_MODE):
|
env, name, cluster_settings=None, mode=settings.DEPLOYMENT_MODE):
|
||||||
return env.fuel_web.create_cluster(
|
return env.fuel_web.create_cluster(
|
||||||
name=name, settings=cluster_settings, mode=mode)
|
name=name, settings=cluster_settings, mode=mode)
|
||||||
|
|
||||||
|
|
||||||
|
def get_plugin_version(filename):
|
||||||
|
"""Extract the plugin version from the package filename.
|
||||||
|
|
||||||
|
:param filename: the plugin's filename.
|
||||||
|
:type filename: str
|
||||||
|
:returns: the plugin's version or None if not found
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
m = PACKAGE_VERSION_RE.search(filename)
|
||||||
|
if m:
|
||||||
|
return m.group(1)
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
class PluginHelper(object):
|
class PluginHelper(object):
|
||||||
"""Class for common help functions."""
|
"""Class for common help functions."""
|
||||||
|
|
||||||
|
@@ -12,14 +12,15 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from stacklight_tests.helpers import helpers
|
||||||
from stacklight_tests import settings
|
from stacklight_tests import settings
|
||||||
|
|
||||||
|
|
||||||
name = 'influxdb_grafana'
|
name = 'influxdb_grafana'
|
||||||
version = '0.9.0'
|
|
||||||
role_name = ['influxdb_grafana']
|
role_name = ['influxdb_grafana']
|
||||||
vip_name = 'influxdb'
|
vip_name = 'influxdb'
|
||||||
plugin_path = settings.INFLUXDB_GRAFANA_PLUGIN_PATH
|
plugin_path = settings.INFLUXDB_GRAFANA_PLUGIN_PATH
|
||||||
|
version = helpers.get_plugin_version(plugin_path)
|
||||||
|
|
||||||
influxdb_db_name = "lma"
|
influxdb_db_name = "lma"
|
||||||
influxdb_user = 'influxdb'
|
influxdb_user = 'influxdb'
|
||||||
|
@@ -12,14 +12,15 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from stacklight_tests.helpers import helpers
|
||||||
from stacklight_tests import settings
|
from stacklight_tests import settings
|
||||||
|
|
||||||
|
|
||||||
name = 'lma_collector'
|
name = 'lma_collector'
|
||||||
version = '0.9.0'
|
|
||||||
role_name = [] # NOTE(rpromyshlennikov): there is no role name
|
role_name = [] # NOTE(rpromyshlennikov): there is no role name
|
||||||
# because lma collector is installed on all nodes in cluster
|
# because lma collector is installed on all nodes in cluster
|
||||||
plugin_path = settings.LMA_COLLECTOR_PLUGIN_PATH
|
plugin_path = settings.LMA_COLLECTOR_PLUGIN_PATH
|
||||||
|
version = helpers.get_plugin_version(plugin_path)
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
'environment_label/value': 'deploy_lma_toolchain',
|
'environment_label/value': 'deploy_lma_toolchain',
|
||||||
|
@@ -12,13 +12,14 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from stacklight_tests.helpers import helpers
|
||||||
from stacklight_tests import settings
|
from stacklight_tests import settings
|
||||||
|
|
||||||
name = 'lma_infrastructure_alerting'
|
name = 'lma_infrastructure_alerting'
|
||||||
version = '0.10.0'
|
|
||||||
role_name = ['infrastructure_alerting']
|
role_name = ['infrastructure_alerting']
|
||||||
vip_name = 'infrastructure_alerting_mgmt_vip'
|
vip_name = 'infrastructure_alerting_mgmt_vip'
|
||||||
plugin_path = settings.LMA_INFRA_ALERTING_PLUGIN_PATH
|
plugin_path = settings.LMA_INFRA_ALERTING_PLUGIN_PATH
|
||||||
|
version = helpers.get_plugin_version(plugin_path)
|
||||||
|
|
||||||
nagios_user = 'nagiosadmin'
|
nagios_user = 'nagiosadmin'
|
||||||
nagios_password = 'r00tme'
|
nagios_password = 'r00tme'
|
||||||
|
Reference in New Issue
Block a user