Commit 7a5d3bbd authored by Iustin Pop's avatar Iustin Pop

Implement “gnt-job list -o +...”

This adds the same “-o +...” functionality in gnt-job as in the node and
instance scripts.

Reviewed-by: imsnah
parent c6868e1d
......@@ -33,12 +33,16 @@ from ganeti import utils
from ganeti import errors
_LIST_DEF_FIELDS = ["id", "status"]
def ListJobs(opts, args):
"""List the jobs
"""
if opts.output is None:
selected_fields = ["id", "status"]
selected_fields = _LIST_DEF_FIELDS
elif opts.output.startswith("+"):
selected_fields = _LIST_DEF_FIELDS + opts.output[1:].split(",")
else:
selected_fields = opts.output.split(",")
......@@ -100,7 +104,7 @@ commands = {
" (see the man page for details): id, status, op_list,"
" op_status, op_result."
" The default field"
" list is (in order): id, status."),
" list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS))
}
......
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