From 52b10746154d57c067b152009bbc13024c2951d9 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Thu, 1 Dec 2016 16:11:17 +0100 Subject: [PATCH] cinder: configure dlm when this one is zookeeper Previous this was set the zake, but that was revert to missing dependencies issue and because zake is a test fixture and not somthing to deploy. This change configures the Cinder dlm with this one is zookeeper. And it installs tooz and the extra dependencies needed for the zookeeper driver. To do it, this commit have to introduce a new method for package installation: 'pip_install_gr_extras package extra1,extra2'. Change-Id: Idca310c08e345db59840eb31434c6cb1f849fa70 --- inc/python | 14 ++++++++++++++ lib/cinder | 7 +++++++ lib/dlm | 1 + 3 files changed, 22 insertions(+) diff --git a/inc/python b/inc/python index 5a9a9ed588..04cde34fe1 100644 --- a/inc/python +++ b/inc/python @@ -69,6 +69,20 @@ function pip_install_gr { pip_install $clean_name } +# Wrapper for ``pip install`` that only installs versions of libraries +# from the global-requirements specification with extras. +# +# Uses globals ``REQUIREMENTS_DIR`` +# +# pip_install_gr_extras packagename extra1,extra2,... +function pip_install_gr_extras { + local name=$1 + local extras=$2 + local clean_name + clean_name=$(get_from_global_requirements $name) + pip_install $clean_name[$extras] +} + # Determine the python versions supported by a package function get_python_versions_for_package { local name=$1 diff --git a/lib/cinder b/lib/cinder index f6ad780bb9..40f0f16d6b 100644 --- a/lib/cinder +++ b/lib/cinder @@ -373,6 +373,13 @@ function configure_cinder { iniset $CINDER_CONF DEFAULT os_privileged_user_password "$SERVICE_PASSWORD" iniset $CINDER_CONF DEFAULT os_privileged_user_tenant "$SERVICE_PROJECT_NAME" iniset $CINDER_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT" + + # Set the backend url according to the configured dlm backend + if is_dlm_enabled; then + if [[ "$(dlm_backend)" == "zookeeper" ]]; then + iniset $CINDER_CONF coordination backend_url "zookeeper://${SERVICE_HOST}:2181" + fi + fi } # create_cinder_accounts() - Set up common required cinder accounts diff --git a/lib/dlm b/lib/dlm index e391535910..b5ac0f5d33 100644 --- a/lib/dlm +++ b/lib/dlm @@ -91,6 +91,7 @@ function configure_dlm { # install_dlm() - Collect source and prepare function install_dlm { if is_dlm_enabled; then + pip_install_gr_extras tooz zookeeper if is_ubuntu; then install_package zookeeperd elif is_fedora; then