]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
init-ceph: print trailing n in "status" output
authorKefu Chai <kchai@redhat.com>
Fri, 10 Feb 2017 09:34:53 +0000 (17:34 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 10 Feb 2017 09:42:55 +0000 (17:42 +0800)
the version command is handled by HelpHook, which does not print newline
at the end of the returned JSON. so the output of "status" subcommand
looks like:

=== osd.1 ===
osd.1: running {"version":"Development"}=== osd.2 ===
osd.2: not running.

with this change, a newline is added to the end of version.

also use the "daemon" subcommand to talk to the asok, let the "ceph" cli
to figure out the asok path.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/init-ceph.in

index 07f49c9458f9b3747d5299c060f11d64888fcced..976e1b3253ef55a86d727bde9c73dca4537a163f 100755 (executable)
@@ -462,7 +462,8 @@ for name in $what; do
        status)
            if daemon_is_running $name ceph-$type $id $pid_file; then
                printf "$name: running "
-               do_cmd "$BINDIR/ceph --admin-daemon $asok version 2>/dev/null" || echo unknown
+               do_cmd "$BINDIR/ceph daemon $name version 2>/dev/null" || printf unknown
+               printf "\n"
             elif [ -e "$pid_file" ]; then
                 # daemon is dead, but pid file still exists
                 echo "$name: dead."