]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_common.sh: add warning if 'host' contains dots
authorDan Mick <dan.mick@inktank.com>
Fri, 8 Mar 2013 23:18:54 +0000 (15:18 -0800)
committerDan Mick <dan.mick@inktank.com>
Sat, 9 Mar 2013 01:10:11 +0000 (17:10 -0800)
This is a common error and there's no reason the script can't
at least tell you it's a really bad idea.  One might argue it
could even successfully proactively truncate the host parameter
at the first dot, but that's a little controlling, perhaps.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
src/ceph_common.sh

index 4851a785e8f85f1136f5cfdc404e7d9c3ba3bb17..76af12979211a4aec75b97da4ba0bd97ffda50f6 100644 (file)
@@ -38,6 +38,11 @@ check_host() {
        echo "$0: use a proper short hostname (hostname -s), not 'localhost', in $conf section $type.$id; skipping entry"
        return 1
     fi
+    if expr match "$host" '.*\.' > /dev/null 2>&1; then
+       echo "$0: $conf section $type.$id"
+       echo "contains host=$host, which contains dots; this is probably wrong"
+       echo "It must match the result of hostname -s"
+    fi
     ssh=""
     rootssh=""
     sshdir=$PWD