]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fix bug in 'defaultweight' calculation on OSD start. 1530/head
authorDmitry Smirnov <onlyjob@member.fsf.org>
Tue, 25 Mar 2014 10:51:01 +0000 (21:51 +1100)
committerDmitry Smirnov <onlyjob@member.fsf.org>
Tue, 25 Mar 2014 23:48:12 +0000 (10:48 +1100)
  awk: cmd. line:1: { d=$2/1073741824 ; r = sprintf(\"%.2f\", d); print r }
  awk: cmd. line:1:                                 ^ backslash not last character on line
  awk: cmd. line:1: { d=$2/1073741824 ; r = sprintf(\"%.2f\", d); print r }
  awk: cmd. line:1:                                 ^ syntax error

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
src/init-ceph.in

index dac00d9054cf21140b00fa601454e9e70fdf7bd1..df23dc4f43b2ecb8e83f7ff5fd203255bc35dbeb 100644 (file)
@@ -323,7 +323,7 @@ for name in $what; do
                    get_conf osd_location_hook "$BINDIR/ceph-crush-location" "osd crush location hook"
                    osd_location=`$osd_location_hook --cluster ceph --id $id --type osd`
                    get_conf osd_weight "" "osd crush initial weight"
-                   defaultweight="$(df -P -k $osd_data/. | tail -1 | awk '{ d=$2/1073741824 ; r = sprintf(\"%.2f\", d); print r }')"
+                   defaultweight="$(df -P -k $osd_data/. | tail -1 | awk '{ print sprintf("%.2f",$2/1073741824) }')"
                    get_conf osd_keyring "$osd_data/keyring" "keyring"
                    do_cmd "timeout 10 $BINDIR/ceph -c $conf --name=osd.$id --keyring=$osd_keyring osd crush create-or-move -- $id ${osd_weight:-${defaultweight:-1}} $osd_location"
                fi