From: Sage Weil Date: Tue, 23 Apr 2013 17:00:38 +0000 (-0700) Subject: init-ceph: fix (and simplify) pushing ceph.conf to remote unique name X-Git-Tag: v0.56.5~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a8e7e9df61a7229d9e2b4b4dedc68b5c1bf15c38;p=ceph.git init-ceph: fix (and simplify) pushing ceph.conf to remote unique name 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 Signed-off-by: Sage Weil (cherry picked from commit ccbc4dbc6edf09626459ca52a53a72682f541e86) --- diff --git a/src/init-ceph.in b/src/init-ceph.in index 41fe4f4f4c82..0295ec94508a 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -213,11 +213,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"