From 1522ac5c15516156bb33f8d47b0c0e7de6cd411f Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Tue, 20 Mar 2012 18:05:18 +0530 Subject: cli: Display available information in "volume status detail" Display the available information in "volume status detail", without failing and erroring out if some information is missing. Change-Id: If8edc268fe91ca9c681f25135738a75eec43b8c3 BUG: 765464 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.com/2989 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-rpc-ops.c') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index b88b523b7c7..d75d095b555 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -4505,6 +4505,9 @@ cli_print_volume_status_clients (dict_t *dict, gf_boolean_t nfs) goto out; cli_out ("Clients connected : %d", client_count); + if (client_count == 0) + continue; + cli_out ("%-48s %15s %15s", "Hostname", "BytesRead", "BytesWritten"); cli_out ("%-48s %15s %15s", "--------", "---------", @@ -5248,12 +5251,13 @@ gf_cli3_1_status_cbk (struct rpc_req *req, struct iovec *iov, cli_out ("\nStatus of volume: %s", volname); - if ((cmd & GF_CLI_STATUS_DETAIL) == 0) + if ((cmd & GF_CLI_STATUS_DETAIL) == 0) { cli_out ("Brick\t\t\t\t\t\t\tPort\tOnline\tPid"); + cli_print_line (CLI_BRICK_STATUS_LINE_LEN); + } for (i = 0; i < count; i++) { - cli_print_line (CLI_BRICK_STATUS_LINE_LEN); memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "brick%d.hostname", i); @@ -5300,6 +5304,7 @@ gf_cli3_1_status_cbk (struct rpc_req *req, struct iovec *iov, ret = cli_get_detail_status (dict, i, &status); if (ret) goto out; + cli_print_line (CLI_BRICK_STATUS_LINE_LEN); cli_print_detailed_status (&status); } else { -- cgit