Browse code

Merge "cinder: configure dlm when this one is zookeeper"

Jenkins authored on 2017/01/12 00:53:04
Showing 3 changed files
... ...
@@ -69,6 +69,20 @@ function pip_install_gr {
69 69
     pip_install $clean_name
70 70
 }
71 71
 
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
+
72 86
 # Determine the python versions supported by a package
73 87
 function get_python_versions_for_package {
74 88
     local name=$1
... ...
@@ -373,6 +373,13 @@ function configure_cinder {
373 373
     iniset $CINDER_CONF DEFAULT os_privileged_user_password "$SERVICE_PASSWORD"
374 374
     iniset $CINDER_CONF DEFAULT os_privileged_user_tenant "$SERVICE_PROJECT_NAME"
375 375
     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
376 383
 }
377 384
 
378 385
 # create_cinder_accounts() - Set up common required cinder accounts
... ...
@@ -91,6 +91,7 @@ function configure_dlm {
91 91
 # install_dlm() - Collect source and prepare
92 92
 function install_dlm {
93 93
     if is_dlm_enabled; then
94
+        pip_install_gr_extras tooz zookeeper
94 95
         if is_ubuntu; then
95 96
             install_package zookeeperd
96 97
         elif is_fedora; then