Fix packaging test to only run lsb_release if it exists

This commit is contained in:
Ryan Ernst 2017-02-16 17:48:08 -08:00
parent 21181d7865
commit f277bef5c0
1 changed files with 6 additions and 4 deletions

View File

@ -87,10 +87,12 @@ setup() {
# Always AssumeMP on RHEL.
# - Resolves: rhbz#1381990
#
# Here we set the "-XX:-AssumeMP" option to false again:
lsb_release=$(lsb_release -i)
if [[ "$lsb_release" =~ "CentOS" ]] || [[ "$lsb_release" =~ "OracleServer" ]]; then
echo "-XX:-AssumeMP" >> $ESCONFIG/jvm.options
if [ -x "$(command -v lsb_release)" ]; then
# Here we set the "-XX:-AssumeMP" option to false again:
lsb_release=$(lsb_release -i)
if [[ "$lsb_release" =~ "CentOS" ]] || [[ "$lsb_release" =~ "OracleServer" ]]; then
echo "-XX:-AssumeMP" >> $ESCONFIG/jvm.options
fi
fi
systemctl start elasticsearch.service