From 7a5d3bbd43a7c217722b67392a272c9224519864 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 1 Jul 2008 09:48:56 +0000 Subject: [PATCH] =?utf8?q?Implement=20=E2=80=9Cgnt-job=20list=20-o=20+...=E2?= =?utf8?q?=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This adds the same “-o +...” functionality in gnt-job as in the node and instance scripts. Reviewed-by: imsnah --- scripts/gnt-job | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/gnt-job b/scripts/gnt-job index e98f637..748a11c 100755 --- a/scripts/gnt-job +++ b/scripts/gnt-job @@ -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)) } -- 1.7.10.4