Browse code

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

Patrick East authored on 2016/07/02 08:08:15
Showing 3 changed files
... ...
@@ -39,7 +39,6 @@ fi
39 39
 
40 40
 # set up default directories
41 41
 GITDIR["python-cinderclient"]=$DEST/python-cinderclient
42
-GITDIR["os-brick"]=$DEST/os-brick
43 42
 GITDIR["python-brick-cinderclient-ext"]=$DEST/python-brick-cinderclient-ext
44 43
 CINDER_DIR=$DEST/cinder
45 44
 
... ...
@@ -445,13 +444,6 @@ function init_cinder {
445 445
 
446 446
 # install_cinder() - Collect source and prepare
447 447
 function install_cinder {
448
-    # Install os-brick from git so we make sure we're testing
449
-    # the latest code.
450
-    if use_library_from_git "os-brick"; then
451
-        git_clone_by_name "os-brick"
452
-        setup_dev_lib "os-brick"
453
-    fi
454
-
455 448
     git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH
456 449
     setup_develop $CINDER_DIR
457 450
     if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
458 451
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+#!/bin/bash
1
+#
2
+# lib/os_brick
3
+# Install **os-brick** python module from source
4
+
5
+# Dependencies:
6
+#
7
+# - functions
8
+# - DEST, DATA_DIR must be defined
9
+
10
+# stack.sh
11
+# ---------
12
+# - install_os_brick
13
+
14
+# Save trace setting
15
+_XTRACE_CINDER=$(set +o | grep xtrace)
16
+set +o xtrace
17
+
18
+
19
+GITDIR["os-brick"]=$DEST/os-brick
20
+
21
+# Install os_brick from git only if requested, otherwise it will be pulled from
22
+# pip repositories by requirements of projects that need it.
23
+function install_os_brick {
24
+    if use_library_from_git "os-brick"; then
25
+        git_clone_by_name "os-brick"
26
+        setup_dev_lib "os-brick"
27
+    fi
28
+}
... ...
@@ -570,6 +570,7 @@ source $TOP_DIR/lib/neutron-legacy
570 570
 source $TOP_DIR/lib/ldap
571 571
 source $TOP_DIR/lib/dstat
572 572
 source $TOP_DIR/lib/dlm
573
+source $TOP_DIR/lib/os_brick
573 574
 
574 575
 # Extras Source
575 576
 # --------------
... ...
@@ -796,6 +797,11 @@ if is_service_enabled heat horizon; then
796 796
     install_heatclient
797 797
 fi
798 798
 
799
+# Install shared libraries
800
+if is_service_enabled cinder nova; then
801
+    install_os_brick
802
+fi
803
+
799 804
 # Install middleware
800 805
 install_keystonemiddleware
801 806