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
This commit is contained in:
Matthew Mosesohn 2016-03-16 17:55:09 +03:00
parent 207f06ecf1
commit 5b67d17439
5 changed files with 13 additions and 15 deletions

View File

@ -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')

View File

@ -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(

View File

@ -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

View File

@ -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)

View File

@ -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
)