]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: ceph-monstore-update-crush: add "--test" to crushtool 6418/head
authorKefu Chai <kchai@redhat.com>
Tue, 27 Oct 2015 02:54:30 +0000 (10:54 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 29 Oct 2015 03:18:46 +0000 (11:18 +0800)
in addition to testing the references to unknown name/type, we should
perform necessary test the crushmap when looking for a good crushmap

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/tools/ceph-monstore-update-crush.sh

index dc6a6d724a50e876676d70ce2ccc54389f804034..7fc41e062c8b11debcb582a1a1a28f377b241422 100755 (executable)
@@ -54,7 +54,7 @@ function test_crush() {
                        -v $epoch -o $osdmap > /dev/null
     osdmaptool --export-crush $crush $osdmap &> /dev/null
 
-    if crushtool --check $max_osd -i $crush > /dev/null; then
+    if crushtool --test --check $max_osd -i $crush > /dev/null; then
         good=true
     else
         good=false
@@ -63,17 +63,6 @@ function test_crush() {
     $good || return 1
 }
 
-function get_crush()  {
-    local store_path=$1
-    local osdmap_epoch=$2
-    local osdmap_path=`mktemp`
-    local crush_path=`mktemp`
-
-    ceph-monstore-tool $store_path get osdmap -- \
-                       -v $osdmap_epoch -o $osdmap_path
-    osdmaptool --export-crush $crush $osdmap_path 2>&1 > /dev/null
-}
-
 function die() {
     local retval=$?
     echo "$@" >&2