From 657cdcdbd18cbdbc185fbf6ef853382b357b3370 Mon Sep 17 00:00:00 2001 From: Patrick East Date: Fri, 1 Jul 2016 16:08:15 -0700 Subject: [PATCH] Allow for Nova to use os-brick from git This option to install os-brick from git was only added into lib/cinder previously. When testing all-in-one nodes this worked fine, but if you have multi-node setups with compute nodes that don't install any c-* services we only get packaged os-brick. With this change non-cinder nodes can now test against unreleased os-bricks. Change-Id: Ibb7423d243d57852dada0b6298463bbdfc6dc63c --- lib/cinder | 8 -------- lib/os_brick | 29 +++++++++++++++++++++++++++++ stack.sh | 6 ++++++ 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 lib/os_brick diff --git a/lib/cinder b/lib/cinder index 0ebf195422..69ff4c4e36 100644 --- a/lib/cinder +++ b/lib/cinder @@ -39,7 +39,6 @@ fi # set up default directories GITDIR["python-cinderclient"]=$DEST/python-cinderclient -GITDIR["os-brick"]=$DEST/os-brick GITDIR["python-brick-cinderclient-ext"]=$DEST/python-brick-cinderclient-ext CINDER_DIR=$DEST/cinder @@ -445,13 +444,6 @@ function init_cinder { # install_cinder() - Collect source and prepare function install_cinder { - # Install os-brick from git so we make sure we're testing - # the latest code. - if use_library_from_git "os-brick"; then - git_clone_by_name "os-brick" - setup_dev_lib "os-brick" - fi - git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH setup_develop $CINDER_DIR if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then diff --git a/lib/os_brick b/lib/os_brick new file mode 100644 index 0000000000..690e321809 --- /dev/null +++ b/lib/os_brick @@ -0,0 +1,29 @@ +#!/bin/bash +# +# lib/os_brick +# Install **os-brick** python module from source + +# Dependencies: +# +# - functions +# - DEST, DATA_DIR must be defined + +# stack.sh +# --------- +# - install_os_brick + +# Save trace setting +_XTRACE_CINDER=$(set +o | grep xtrace) +set +o xtrace + + +GITDIR["os-brick"]=$DEST/os-brick + +# Install os_brick from git only if requested, otherwise it will be pulled from +# pip repositories by requirements of projects that need it. +function install_os_brick { + if use_library_from_git "os-brick"; then + git_clone_by_name "os-brick" + setup_dev_lib "os-brick" + fi +} diff --git a/stack.sh b/stack.sh index 6fbb0bee3b..5a5a040b02 100755 --- a/stack.sh +++ b/stack.sh @@ -570,6 +570,7 @@ source $TOP_DIR/lib/neutron-legacy source $TOP_DIR/lib/ldap source $TOP_DIR/lib/dstat source $TOP_DIR/lib/dlm +source $TOP_DIR/lib/os_brick # Extras Source # -------------- @@ -796,6 +797,11 @@ if is_service_enabled heat horizon; then install_heatclient fi +# Install shared libraries +if is_service_enabled cinder nova; then + install_os_brick +fi + # Install middleware install_keystonemiddleware