hadoop: use a case for distro check

Copy the switch case from 50-download-hadoop to ease the check for the
supported distro.

Should have no functional change.

Change-Id: I28899aff7e25adacd0c2458e12a38e92b5d530cf
This commit is contained in:
Pino Toscano 2015-06-16 18:47:34 +02:00
parent f6c8afb624
commit 104702cb62
1 changed files with 8 additions and 4 deletions

View File

@ -118,10 +118,14 @@ EOF
ln -s ${HADOOP_HOME}/share/hadoop/tools/lib/hadoop-openstack-${DIB_HADOOP_VERSION}.jar ${HADOOP_HOME}/share/hadoop/common/lib/
}
if [ ! "$DISTRO_NAME" == "fedora" -a ! "$DISTRO_NAME" == "ubuntu" -a ! "$DISTRO_NAME" == "rhel" -a ! "$DISTRO_NAME" == "centos" ]; then
echo "Unknown distro: $DISTRO_NAME. Exiting."
exit 1
fi
case "$DISTRO_NAME" in
fedora | ubuntu | rhel | centos )
;;
*)
echo "Unknown distro: $DISTRO_NAME. Exiting."
exit 1
;;
esac
echo "Hadoop setup begins for $DISTRO_NAME"
tmp_dir=/tmp/hadoop