summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2012-10-22 10:18:32 +0530
committerVijay Bellur <vbellur@redhat.com>2012-10-30 23:07:47 -0700
commit0608244512f1ab0ba9916ab3da9f0bc57ee234fc (patch)
treed8eeb5c3bf79e6ab2425fc3e35c8f22c992ac6f2 /cli/src/cli-cmd-volume.c
parentd7cc779da48e484d0edb7bfbd903f941d0ccca32 (diff)
cli: Mark port as N/A in volume status when process is not online
Change-Id: Ie11c7331e3bc58c0f934f424dde4341cdffb9e2c BUG: 861542 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/4048 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index ac70cd5c068..f7586c44c11 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1490,7 +1490,10 @@ void
cli_print_detailed_status (cli_volume_status_t *status)
{
cli_out ("%-20s : %-20s", "Brick", status->brick);
- cli_out ("%-20s : %-20d", "Port", status->port);
+ if (status->online)
+ cli_out ("%-20s : %-20d", "Port", status->port);
+ else
+ cli_out ("%-20s : %-20s", "Port", "N/A");
cli_out ("%-20s : %-20c", "Online", (status->online) ? 'Y' : 'N');
cli_out ("%-20s : %-20s", "Pid", status->pid_str);
@@ -1565,10 +1568,18 @@ cli_print_brick_status (cli_volume_status_t *status)
printf ("%s", p);
while (num_tabs-- != 0)
printf ("\t");
- if (status->port)
- cli_out ("%d\t%c\t%s",
- status->port, status->online?'Y':'N',
- status->pid_str);
+ if (status->port) {
+ if (status->online)
+ cli_out ("%d\t%c\t%s",
+ status->port,
+ status->online?'Y':'N',
+ status->pid_str);
+ else
+ cli_out ("%s\t%c\t%s",
+ "N/A",
+ status->online?'Y':'N',
+ status->pid_str);
+ }
else
cli_out ("%s\t%c\t%s",
"N/A", status->online?'Y':'N',