From 5b67d1743946d4d8ab37befc683f82e7ec206cfc Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Wed, 16 Mar 2016 17:55:09 +0300 Subject: [PATCH] Refactor UCA deployment to separate release Renamed Ubuntu release to Ubuntu 14.04. UCA release is now called Ubuntu+UCA 14.04 so it can be identified with find() in get_release method. Fixed several lookups for lookups of OPENSTACK_RELEASE. Change-Id: I998ff288282db94bfbc7bbe5bedb1c420b09f452 Partial-Bug: #1556011 --- fuelweb_test/helpers/ceph.py | 8 ++++---- fuelweb_test/helpers/decorators.py | 2 +- fuelweb_test/helpers/uca.py | 6 +----- fuelweb_test/settings.py | 11 ++++++----- fuelweb_test/tests/tests_uca/test_uca.py | 1 + 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/fuelweb_test/helpers/ceph.py b/fuelweb_test/helpers/ceph.py index 15d289b2f..def9d468a 100644 --- a/fuelweb_test/helpers/ceph.py +++ b/fuelweb_test/helpers/ceph.py @@ -32,9 +32,9 @@ def start_monitor(remote): """ logger.debug("Starting Ceph monitor on {0}".format(remote.host)) check_distribution() - if OPENSTACK_RELEASE == OPENSTACK_RELEASE_UBUNTU: + if OPENSTACK_RELEASE_UBUNTU in OPENSTACK_RELEASE: run_on_remote(remote, 'start ceph-mon-all') - if OPENSTACK_RELEASE == OPENSTACK_RELEASE_CENTOS: + if OPENSTACK_RELEASE_CENTOS in OPENSTACK_RELEASE: run_on_remote(remote, '/etc/init.d/ceph start') @@ -47,9 +47,9 @@ def stop_monitor(remote): """ logger.debug("Stopping Ceph monitor on {0}".format(remote.host)) check_distribution() - if OPENSTACK_RELEASE == OPENSTACK_RELEASE_UBUNTU: + if OPENSTACK_RELEASE_UBUNTU in OPENSTACK_RELEASE: run_on_remote(remote, 'stop ceph-mon-all') - if OPENSTACK_RELEASE == OPENSTACK_RELEASE_CENTOS: + if OPENSTACK_RELEASE_CENTOS in OPENSTACK_RELEASE: run_on_remote(remote, '/etc/init.d/ceph stop') diff --git a/fuelweb_test/helpers/decorators.py b/fuelweb_test/helpers/decorators.py index 564c19d83..0f940d490 100644 --- a/fuelweb_test/helpers/decorators.py +++ b/fuelweb_test/helpers/decorators.py @@ -490,7 +490,7 @@ def check_repos_management(func): def wrapper(*args, **kwargs): result = func(*args, **kwargs) # FIXME: Enable me for all release after fix #1403088 and #1448114 - if settings.OPENSTACK_RELEASE == settings.OPENSTACK_RELEASE_UBUNTU: + if settings.OPENSTACK_RELEASE_UBUNTU in settings.OPENSTACK_RELEASE: try: env = get_current_env(args) nailgun_nodes = env.fuel_web.client.list_cluster_nodes( diff --git a/fuelweb_test/helpers/uca.py b/fuelweb_test/helpers/uca.py index 46132dbc0..9a596a763 100644 --- a/fuelweb_test/helpers/uca.py +++ b/fuelweb_test/helpers/uca.py @@ -23,8 +23,7 @@ def change_cluster_uca_config(cluster_attributes): # check attributes have uca options - for option in ["repo_type", "uca_repo_url", "uca_openstack_release", - "pin_haproxy", "pin_rabbitmq", "pin_ceph"]: + for option in ["pin_haproxy", "pin_rabbitmq", "pin_ceph"]: asserts.assert_true( option in cluster_attributes["editable"]["repo_setup"], "{0} is not in cluster attributes: {1}". @@ -33,9 +32,6 @@ def change_cluster_uca_config(cluster_attributes): # enable UCA repository uca_options = cluster_attributes["editable"]["repo_setup"] - uca_options["repo_type"]["value"] = settings.UCA_REPO_TYPE - uca_options["uca_repo_url"]["value"] = settings.UCA_REPO_URL - uca_options["uca_openstack_release"]["value"] = settings.UCA_RELEASE uca_options["pin_haproxy"]["value"] = settings.UCA_PIN_HAPROXY uca_options["pin_rabbitmq"]["value"] = settings.UCA_PIN_RABBITMQ uca_options["pin_ceph"]["value"] = settings.UCA_PIN_RABBITMQ diff --git a/fuelweb_test/settings.py b/fuelweb_test/settings.py index e3747ea8c..c02740838 100644 --- a/fuelweb_test/settings.py +++ b/fuelweb_test/settings.py @@ -67,10 +67,15 @@ PATH_TO_PEM = os.environ.get('PATH_TO_PEM', os.path.join( SSL_CERTS_DIR, 'ca.pem')) OPENSTACK_RELEASE_CENTOS = 'centos' -OPENSTACK_RELEASE_UBUNTU = 'ubuntu' +OPENSTACK_RELEASE_UBUNTU = 'Ubuntu 14.04' +OPENSTACK_RELEASE_UBUNTU_UCA = 'Ubuntu+UCA 14.04' OPENSTACK_RELEASE = os.environ.get( 'OPENSTACK_RELEASE', OPENSTACK_RELEASE_UBUNTU).lower() +# FIXME(mattmymo): Update CI jobs to use 'Ubuntu 14.04' for OPENSTACK_RELEASE +if OPENSTACK_RELEASE.lower() == 'ubuntu': + OPENSTACK_RELEASE = OPENSTACK_RELEASE_UBUNTU + DEPLOYMENT_MODE_SIMPLE = "multinode" DEPLOYMENT_MODE_HA = "ha_compact" DEPLOYMENT_MODE = os.environ.get("DEPLOYMENT_MODE", DEPLOYMENT_MODE_HA) @@ -571,10 +576,6 @@ EMC_POOL_NAME = os.environ.get('EMC_POOL_NAME', '') UCA_ENABLED = os.environ.get('UCA_ENABLED', False) UCA_REPO_TYPE = os.environ.get('UCA_REPO_TYPE', 'uca') -UCA_REPO_URL = os.environ.get( - 'UCA_REPO_URL', - 'http://ubuntu-cloud.archive.canonical.com/ubuntu') -UCA_RELEASE = os.environ.get('UCA_RELEASE', 'mitaka') UCA_PIN_HAPROXY = get_var_as_bool('UCA_PIN_HAPROXY', True) UCA_PIN_RABBITMQ = get_var_as_bool('UCA_PIN_RABBITMQ', True) UCA_PIN_CEPH = get_var_as_bool('UCA_PIN_CEPH', True) diff --git a/fuelweb_test/tests/tests_uca/test_uca.py b/fuelweb_test/tests/tests_uca/test_uca.py index d6e069373..9fb5600a4 100644 --- a/fuelweb_test/tests/tests_uca/test_uca.py +++ b/fuelweb_test/tests/tests_uca/test_uca.py @@ -51,6 +51,7 @@ class UCATest(TestBasic): cluster_id = self.fuel_web.create_cluster( name=self.__class__.__name__, mode=settings.DEPLOYMENT_MODE, + release_name=settings.OPENSTACK_RELEASE_UBUNTU_UCA, settings=uca_enabled )