Merge "Add pike combo to carbon and nitrogen jobs"
[releng/builder.git] / packer / provision / devstack-pre-pip.sh
index 936ac3bd1bbfd5aca8e4c616fe1ad7e2b3c3503f..5153a4a6d5c2d6279a746b311da5fea0ce391d1e 100644 (file)
@@ -1,7 +1,18 @@
 #!/bin/bash
 
+# force any errors to cause the script and job to end in failure
+set -xeu -o pipefail
+
+# add in a test copr repo
+wget http://copr.fedoraproject.org/coprs/tykeal/odl-updates/repo/epel-7/tykeal-odl-updates-epel-7.repo -O /etc/yum.repos.d/tykeal-odl-updates-epel-7.repo
+# Install xpath
+yum install -y perl-XML-XPath python-pip python-six
+
+# install crudini command line tool for editing config files
+yum install -y crudini
+
 echo '---> Installing non-baseline requirements'
-yum install -y deltarpm python{,-{crypto,devel,lxml,setuptools}} \
+yum install -y deltarpm nc python{,-{crypto,devel,lxml,setuptools}} \
     @development {lib{xml2,xslt,ffi},openssl}-devel git wget
 
 echo '---> Updating net link setup'
@@ -11,7 +22,10 @@ fi
 
 echo '---> Pre-installing yum and pip packages'
 projs="requirements keystone glance cinder neutron nova horizon"
+# shellcheck disable=SC2154
 branch=${os_branch}
+# strip the "stable" off of the branch
+branch_name=$(cut -d'/' -f2 <<< ${branch})
 
 wget https://bootstrap.pypa.io/get-pip.py
 python get-pip.py
@@ -32,6 +46,11 @@ do
     pip install -c requirements/upper-constraints.txt -r ${proj}/test-requirements.txt
 done
 
+echo '---> Installing openvswitch from relevant openstack branch'
+yum install -y centos-release-openstack-${branch_name}
+
+yum install -y --nogpgcheck openvswitch
+
 cd $OLDPWD
 rm -fr tmp