From: Joao Eduardo Luis Date: Mon, 13 Jul 2015 14:05:50 +0000 (+0100) Subject: tools: ceph-monstore-update-crush: fail early if mon's running X-Git-Tag: v9.1.0~527^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8eb9a34ddd352d364bd7e4654f6e80b63e88d7a7;p=ceph.git tools: ceph-monstore-update-crush: fail early if mon's running Signed-off-by: Joao Eduardo Luis --- diff --git a/src/tools/ceph-monstore-update-crush.sh b/src/tools/ceph-monstore-update-crush.sh index 3f24a08364320..dc6a6d724a50e 100755 --- a/src/tools/ceph-monstore-update-crush.sh +++ b/src/tools/ceph-monstore-update-crush.sh @@ -35,7 +35,8 @@ function osdmap_get() { local osdmap=`mktemp` ceph-monstore-tool $store_path get osdmap -- \ - $epoch -o $osdmap > /dev/null + $epoch -o $osdmap > /dev/null || return + echo $(osdmaptool --dump xml $osdmap 2> /dev/null | \ $XMLSTARLET sel -t -m "$query" -v .) @@ -73,6 +74,12 @@ function get_crush() { osdmaptool --export-crush $crush $osdmap_path 2>&1 > /dev/null } +function die() { + local retval=$? + echo "$@" >&2 + exit $retval +} + function usage() { [ $# -gt 0 ] && echo -e "\n$@" cat <