From 7c359241f2c34d455db434896c1510f904b4d1fc Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sun, 16 Aug 2020 14:16:20 -0400 Subject: [PATCH] Add dashboard override --- README.rst | 7 +++++-- tempest_pushgateway/__init__.py | 12 +++++++++++- tox.ini | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index b72fbb1..42f7ae6 100644 --- a/README.rst +++ b/README.rst @@ -16,5 +16,8 @@ Usage You can use the Docker container which is published to ``vexxhost/tempest-pushgateway`` and provide your OpenStack creentials in the environment, alternatively you can simply install this locally and call ``tempest-pushgateway`` directly. The -only requirement is to set ``TEMPEST_PROMETHEUS`` environment variable to point -towards your Prometheus Pushgateway. +tool is entirely configured using environment variables: + +- ``TEMPEST_PROMETHEUS`` (required): Prometheus Pushgateway address +- ``TEMPEST_HORIZON_URL``: URL for Horizon if ``python-tempestconf`` fails to + detect it. diff --git a/tempest_pushgateway/__init__.py b/tempest_pushgateway/__init__.py index 77038bc..8ab9b14 100644 --- a/tempest_pushgateway/__init__.py +++ b/tempest_pushgateway/__init__.py @@ -97,11 +97,21 @@ def main(): tempest_conf = tempfile.NamedTemporaryFile(mode='w+') accounts_file = tempfile.NamedTemporaryFile(mode='w+') + overrides = [ + ('validation', 'connect_method', 'fixed'), + ] + + if os.getenv('TEMPEST_HORIZON_URL'): + url = os.getenv('TEMPEST_HORIZON_URL') + overrides.append(('service_available', 'horizon', 'True')) + overrides.append(('dashboard', 'dashboard_url', url)) + overrides.append(('dashboard', 'login_url', url + '/auth/login/')) + cloud_creds = tempestconf.get_cloud_creds(args) tempestconf.config_tempest( cloud_creds=cloud_creds, convert_to_raw=True, create_accounts_file=accounts_file.name, debug=True, non_admin=True, - out=tempest_conf.name, remove=[ + out=tempest_conf.name, overrides=overrides, remove=[ 'network.floating_network_name' ] ) diff --git a/tox.ini b/tox.ini index 7641909..c3a8aa9 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ usedevelop = True passenv = OS_* + TEMPEST_* deps = -rtest-requirements.txt -rrequirements.txt