]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph: fix (and simplify) pushing ceph.conf to remote unique name 237/head
authorSage Weil <sage@inktank.com>
Tue, 23 Apr 2013 17:00:38 +0000 (10:00 -0700)
committerSage Weil <sage@inktank.com>
Tue, 23 Apr 2013 17:00:38 +0000 (10:00 -0700)
The old code would only do the push once per remote node (due to the
list in $pushed_to) but would reset $unique on each attempt.  This would
break if a remote host was processed twice.

Fix by just skipping the $pushed_to optimization entirely.

Fixes: #4794
Reported-by: Andreas Friedrich <andreas.friedrich@ts.fujitsu.com>
Signed-off-by: Sage Weil <sage@inktank.com>
src/init-ceph.in

index c2148822b6cfd3c3ad7c82ce77043fdf500d2353..61c10e169720ac6b28abf6f4fa140adb3f3db313 100644 (file)
@@ -217,11 +217,8 @@ for name in $what; do
        cur_conf=$conf
     else
        unique=`dd if=/dev/urandom bs=16 count=1 2>/dev/null | md5sum | awk '{print $1}'`
-       if echo $pushed_to | grep -v -q " $host "; then
-           scp -q $conf $host:/tmp/ceph.conf.$unique
-           trap "ssh $host rm /tmp/ceph.conf.$unique" EXIT
-           pushed_to="$pushed_to $host "
-       fi
+       scp -q $conf $host:/tmp/ceph.conf.$unique
+       trap "ssh $host rm /tmp/ceph.conf.$unique" EXIT
        cur_conf="/tmp/ceph.conf.$unique"
     fi
     cmd="$cmd -c $cur_conf"