install oslo from upstream in devstack

the libraries that have graduated from oslo incubation need to be
made available in devstack so that projects can develop against
upstream versions of these libraries, and that we can test their
compatibility in the gate.

This should also allow us to force global requirements on all the
projects during installation.

Change-Id: Idf527b16b50eb58564ec74428290cd31424f5de2
diff --git a/lib/oslo b/lib/oslo
new file mode 100644
index 0000000..1eb13db
--- /dev/null
+++ b/lib/oslo
@@ -0,0 +1,42 @@
+# lib/oslo
+#
+# Functions to install oslo libraries from git
+#
+# We need this to handle the fact that projects would like to use
+# pre-released versions of oslo libraries.
+
+# Dependencies:
+# ``functions`` file
+
+# ``stack.sh`` calls the entry points in this order:
+#
+# install_oslo
+
+# Save trace setting
+XTRACE=$(set +o | grep xtrace)
+set +o xtrace
+
+
+# Defaults
+# --------
+OSLOCFG_DIR=$DEST/oslo.config
+OSLOMSG_DIR=$DEST/oslo.messaging
+
+# Entry Points
+# ------------
+
+# install_oslo() - Collect source and prepare
+function install_oslo() {
+    git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
+    setup_develop $OSLOCFG_DIR
+
+    git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
+    setup_develop $OSLOMSG_DIR
+}
+
+# Restore xtrace
+$XTRACE
+
+# Local variables:
+# mode: shell-script
+# End:
diff --git a/stack.sh b/stack.sh
index 4e23505..5013b0a 100755
--- a/stack.sh
+++ b/stack.sh
@@ -299,6 +299,7 @@
 
 # Source project function libraries
 source $TOP_DIR/lib/tls
+source $TOP_DIR/lib/oslo
 source $TOP_DIR/lib/horizon
 source $TOP_DIR/lib/keystone
 source $TOP_DIR/lib/glance
@@ -661,6 +662,9 @@
 git_clone $PBR_REPO $PBR_DIR $PBR_BRANCH
 setup_develop $PBR_DIR
 
+# Install oslo libraries that have graduated
+install_oslo
+
 # Install clients libraries
 install_keystoneclient
 install_glanceclient
diff --git a/stackrc b/stackrc
index ac72132..3e93d23 100644
--- a/stackrc
+++ b/stackrc
@@ -116,6 +116,14 @@
 OPENSTACKCLIENT_REPO=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
 OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master}
 
+# oslo.config
+OSLOCFG_REPO=${OSLOCFG_REPO:-${GIT_BASE}/openstack/oslo.config.git}
+OSLOCFG_BRANCH=${OSLOCFG_BRANCH:-master}
+
+# oslo.messaging
+OSLOMSG_REPO=${OSLOMSG_REPO:-${GIT_BASE}/openstack/oslo.messaging.git}
+OSLOMSG_BRANCH=${OSLOMSG_BRANCH:-master}
+
 # pbr drives the setuptools configs
 PBR_REPO=${PBR_REPO:-${GIT_BASE}/openstack-dev/pbr.git}
 PBR_BRANCH=${PBR_BRANCH:-master}