From 193a8190ce16d6b356957d77c81c78eaed20d962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Thu, 20 Oct 2016 18:11:26 +0200 Subject: [PATCH] Fix broken test in vagrant boostrap script The file path was not properly passed to the '-x' test which caused it to always return true. This commit simplifies the test for existing command by relying only on the exit code of `type` rather than checking that the file path is executable. Change-Id: Iaf47d92ff9fd1ef34d8d7492c08ec24d2b8a9536 Closes-Bug: #1635341 --- contrib/dev/vagrant/bootstrap.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/dev/vagrant/bootstrap.sh b/contrib/dev/vagrant/bootstrap.sh index ec89440b89..b9ac831bc8 100644 --- a/contrib/dev/vagrant/bootstrap.sh +++ b/contrib/dev/vagrant/bootstrap.sh @@ -24,13 +24,13 @@ REGISTRY=${REGISTRY_URL}:${REGISTRY_PORT} ADMIN_PROTOCOL="http" function _ensure_lsb_release { - if [[ -x $(type lsb_release 2>/dev/null) ]]; then + if type lsb_release >/dev/null 2>&1; then return fi - if [[ -x $(type apt-get 2>/dev/null) ]]; then + if type apt-get >/dev/null 2>&1; then apt-get -y install lsb-release - elif [[ -x $(type yum 2>/dev/null) ]]; then + elif type yum >/dev/null 2>&1; then yum -y install redhat-lsb-core fi }