Commit 2da31181 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix --no-headers for the new list-drbd command



Sorry, I forgot that with GenerateTable this needs to be handled
manually. Fixed now and tested in both ways.

(But to be honest, this should be abstracted in GenerateTable, instead
of the 'if' test in all its callers.)
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 286b7335
......@@ -960,8 +960,11 @@ def ListDrbd(opts, args):
return constants.EXIT_FAILURE
fields = ["node", "minor", "instance", "disk", "role", "peer"]
headers = {"node": "Node", "minor": "Minor", "instance": "Instance",
"disk": "Disk", "role": "Role", "peer": "PeerNode"}
if opts.no_headers:
headers = None
else:
headers = {"node": "Node", "minor": "Minor", "instance": "Instance",
"disk": "Disk", "role": "Role", "peer": "PeerNode"}
data = GenerateTable(separator=opts.separator, headers=headers,
fields=fields, data=sorted(status.answer),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment