From 10294fa2936056a0a4877e355c7da762fa444bd2 Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 13 May 2014 17:30:45 +0100 Subject: [PATCH] Fix the output of "vos listvldb" Fix the output of "vos listvldb" in the following ways: (1) Print a blank line between records in the output. (2) Adjust the indentation. (3) Don't print RW/RO/Backup volume IDs if the corresponding VLSF_xxVOL flag is not set. Signed-off-by: David Howells --- suite/commands/vos/listvldb.py | 16 +++++++++++----- suite/lib/voldisplay.py | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/suite/commands/vos/listvldb.py b/suite/commands/vos/listvldb.py index 43914dd..28a6284 100644 --- a/suite/commands/vos/listvldb.py +++ b/suite/commands/vos/listvldb.py @@ -62,11 +62,17 @@ Displays a volume's VLDB entry def print_record(params, vldb): """Display a single VLDB record""" output(vldb.name, "\n") - outputf(" RWrite: {:<12d} ROnly: {:<12d} Backup: {:<12d}\n", - vldb.volumeId[0], - vldb.volumeId[1], - vldb.volumeId[2]) - display_vldb_site_list(params, vldb) + output(" "); + flags = vldb.serverFlags[0] + if flags & kafs.VLSF_RWVOL: + outputf(" RWrite: {:<12d}", vldb.volumeId[0]) + if flags & kafs.VLSF_ROVOL: + outputf(" ROnly: {:<12d}", vldb.volumeId[1]) + if flags & kafs.VLSF_BACKVOL: + outputf(" Backup: {:<12d}",vldb.volumeId[2]) + output("\n") + display_vldb_site_list(params, vldb, " ") + output("\n") def main(params): # Get a list of VLDB servers to query diff --git a/suite/lib/voldisplay.py b/suite/lib/voldisplay.py index 2ae7ade..eed0c42 100644 --- a/suite/lib/voldisplay.py +++ b/suite/lib/voldisplay.py @@ -93,7 +93,7 @@ def display_vldb_site_list(params, vldb, indent=""): else: ptype = "Back" - outputf("{:s} server {:s} partition {:s} {:s} Site\n", + outputf("{:s} server {:s} partition {:s} {:s} Site\n", indent, addr, part, ptype) if vldb.flags & (kafs.VLOP_MOVE | -- 2.49.0