From 28c69f64406b22c64a4d14b0ac48679f33c256ad Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Wed, 23 Oct 2013 17:37:05 -0200 Subject: [PATCH] Adding nodepool compatibility with Fedora. This patch will check if the distro is Fedora or Red Hat, if so, it will execute yum to install package requirements, otherwise, it will run the default apt-get. Change-Id: Ife8b214dd3b4cb12cf11c1da673b834b6180f9e7 --- .../nodepool/scripts/prepare_devstack.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_devstack.sh b/modules/openstack_project/files/nodepool/scripts/prepare_devstack.sh index eb12ac0920..2d0ea02d79 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_devstack.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_devstack.sh @@ -18,10 +18,18 @@ mkdir -p ~/cache/files mkdir -p ~/cache/pip -sudo DEBIAN_FRONTEND=noninteractive apt-get \ - --option "Dpkg::Options::=--force-confold" \ - --assume-yes install build-essential python-dev \ - linux-headers-virtual linux-headers-`uname -r` + +if [ -f /usr/bin/yum ]; then + sudo yum -y install python-devel make automake gcc gcc-c++ kernel-devel redhat-lsb-core +elif [ -f /usr/bin/apt-get ]; then + sudo DEBIAN_FRONTEND=noninteractive apt-get \ + --option "Dpkg::Options::=--force-confold" \ + --assume-yes install build-essential python-dev \ + linux-headers-virtual linux-headers-`uname -r` +else + echo "Unsupported distro." + exit 1 +fi rm -rf ~/workspace-cache mkdir -p ~/workspace-cache @@ -59,7 +67,8 @@ git clone https://review.openstack.org/p/openstack/tempest git clone https://review.openstack.org/p/stackforge/pecan git clone https://review.openstack.org/p/stackforge/wsme -. /etc/lsb-release +DISTRIB_CODENAME=`lsb_release -sc` + cd /opt/nodepool-scripts/ python ./devstack-cache.py $DISTRIB_CODENAME