Skip to content

Commit 52b1074

Browse files
author
Mehdi Abaakouk
committed
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
1 parent 72bfe17 commit 52b1074

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

inc/python

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ function pip_install_gr {
6969
pip_install $clean_name
7070
}
7171

72+
# Wrapper for ``pip install`` that only installs versions of libraries
73+
# from the global-requirements specification with extras.
74+
#
75+
# Uses globals ``REQUIREMENTS_DIR``
76+
#
77+
# pip_install_gr_extras packagename extra1,extra2,...
78+
function pip_install_gr_extras {
79+
local name=$1
80+
local extras=$2
81+
local clean_name
82+
clean_name=$(get_from_global_requirements $name)
83+
pip_install $clean_name[$extras]
84+
}
85+
7286
# Determine the python versions supported by a package
7387
function get_python_versions_for_package {
7488
local name=$1

lib/cinder

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,13 @@ function configure_cinder {
373373
iniset $CINDER_CONF DEFAULT os_privileged_user_password "$SERVICE_PASSWORD"
374374
iniset $CINDER_CONF DEFAULT os_privileged_user_tenant "$SERVICE_PROJECT_NAME"
375375
iniset $CINDER_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
376+
377+
# Set the backend url according to the configured dlm backend
378+
if is_dlm_enabled; then
379+
if [[ "$(dlm_backend)" == "zookeeper" ]]; then
380+
iniset $CINDER_CONF coordination backend_url "zookeeper://${SERVICE_HOST}:2181"
381+
fi
382+
fi
376383
}
377384

378385
# create_cinder_accounts() - Set up common required cinder accounts

lib/dlm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function configure_dlm {
9191
# install_dlm() - Collect source and prepare
9292
function install_dlm {
9393
if is_dlm_enabled; then
94+
pip_install_gr_extras tooz zookeeper
9495
if is_ubuntu; then
9596
install_package zookeeperd
9697
elif is_fedora; then

0 commit comments

Comments
 (0)