From f458c9a9a74d37a97242e46248c797f505f579dd Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Tue, 27 Oct 2015 11:40:32 -0500 Subject: [PATCH] check the exit status of chacractl exists Signed-off-by: Andrew Schoen --- ceph-build-next/build/build_deb | 6 +++--- ceph-build-next/build/build_rpm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ceph-build-next/build/build_deb b/ceph-build-next/build/build_deb index a3d0ba08..ff83d13e 100644 --- a/ceph-build-next/build/build_deb +++ b/ceph-build-next/build/build_deb @@ -11,11 +11,11 @@ vers=`cat ./dist/version` distro=`python -c "exec 'import platform; print platform.linux_distribution()[0].lower()'"` chacra_endpoint="ceph/${chacra_ref}/${distro}/{$dist}/${ARCH}" -binary_exists=`chacractl binary exists ${chacra_endpoint}` +chacractl binary exists ${chacra_endpoint} # if the binary already exists in chacra, do not rebuild -if [ "$binary_exists" = true ] ; then - echo "The binary at ${chacra_endpoint} already exists, Exiting..." +if [ $? -e 0 ] ; then + echo "The endpoint at ${chacra_endpoint} already exists, Exiting..." exit 0 fi diff --git a/ceph-build-next/build/build_rpm b/ceph-build-next/build/build_rpm index 2ff475ec..adf0d5a3 100644 --- a/ceph-build-next/build/build_rpm +++ b/ceph-build-next/build/build_rpm @@ -58,11 +58,11 @@ vers=`cat ./dist/version` [ "$TEST" = true ] && chacra_ref="$vers" || chacra_ref="test" chacra_baseurl="ceph/${chacra_ref}/${DISTRO}/${RELEASE}" -binary_exists=`chacractl binary exists ${chacra_baseurl}/${ARCH}` +chacractl binary exists ${chacra_baseurl}/${ARCH} # if the binary already exists in chacra, do not rebuild -if [ "$binary_exists" = true ] ; then - echo "The binary at ${chacra_baseurl}/${ARCH} already exists, Exiting..." +if [ $? -e 0 ] ; then + echo "The endpoint at ${chacra_baseurl}/${ARCH} already exists, Exiting..." exit 0 fi -- 2.39.5