Signed-off-by: Andrew Schoen <aschoen@redhat.com>
distro=`python -c "exec 'import platform; print platform.linux_distribution()[0].lower()'"`
chacra_endpoint="ceph/${chacra_ref}/${distro}/{$dist}/${ARCH}"
-chacractl exists binaries/${chacra_endpoint}
+chacractl exists binaries/${chacra_endpoint}; exists=$? || true
# if the binary already exists in chacra, do not rebuild
-if [ $? -e 0 ] && [ "$FORCE" = false ] ; then
+if [ $exists -e 0 ] && [ "$FORCE" = false ] ; then
echo "The endpoint at ${chacra_endpoint} already exists and FORCE was not set, Exiting..."
exit 0
fi
[ "$TEST" = true ] && chacra_ref="$vers" || chacra_ref="test"
chacra_baseurl="ceph/${chacra_ref}/${DISTRO}/${RELEASE}"
-chacractl exists binaries/${chacra_baseurl}/${ARCH}
+chacractl exists binaries/${chacra_baseurl}/${ARCH}; exists=$? || true
# if the binary already exists in chacra, do not rebuild
-if [ $? -e 0 ] && [ "$FORCE" = false ]; then
+if [ $exists -e 0 ] && [ "$FORCE" = false ]; then
echo "The endpoint at ${chacra_baseurl}/${ARCH} already exists and FORCE was not set, Exiting..."
exit 0
fi