]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mkcephfs: fix bug in multi-node setups
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 7 Feb 2011 11:24:38 +0000 (03:24 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 7 Feb 2011 12:34:53 +0000 (04:34 -0800)
mkcephfs needs to create $TDIR on the other nodes in a multi-node setup
before trying to scp files into that directory.

Also, do mkdir -p on the directory where the configuration is going to
go.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/mkcephfs.in

index 5a4f29fc7f75f0a0c69d9f9c601abe7abed43372..a754165f49bf7708d5b82a7ae460168d53b13ea4 100644 (file)
@@ -189,6 +189,9 @@ for name in $what; do
     check_host || continue
 
     if [ -n "$ssh" ] && ( echo $pushed_to | grep -v -q " $host " ); then
+        conf_dir=`dirname "$conf"`
+        ssh $host mkdir -p "$conf_dir"
+        ssh $host mkdir -p "$TDIR"
        scp -q $conf $host:$conf
        scp -q $osdmap $host:$osdmap
        scp -q $monmap $host:$monmap
@@ -279,7 +282,9 @@ for name in $what; do
        fi
        rm -f $TDIR/keyring.mds.$id
     fi
-
+    if [ -n "$ssh" ]; then
+        ssh $host rm -rf $TDIR
+    fi
 done
 
 rm -f $monkeyring