From 0ad64cf8530c5c2438722bbd561867fa8d8ffd4f Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Thu, 24 Jul 2008 15:04:09 +0000
Subject: [PATCH] =?UTF-8?q?Implement=20=E2=80=9Cgnt-job=20archive=E2=80=9D?=
 =?UTF-8?q?=20to=20archive=20jobs?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed-by: iustinp
---
 scripts/gnt-job | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/scripts/gnt-job b/scripts/gnt-job
index 6a82561de..698e8688a 100755
--- a/scripts/gnt-job
+++ b/scripts/gnt-job
@@ -43,6 +43,7 @@ _USER_JOB_STATUS = {
   constants.JOB_STATUS_ERROR: "error",
   }
 
+
 def ListJobs(opts, args):
   """List the jobs
 
@@ -92,6 +93,15 @@ def ListJobs(opts, args):
   return 0
 
 
+def ArchiveJobs(opts, args):
+  client = GetClient()
+
+  for job_id in args:
+    client.ArchiveJob(job_id)
+
+  return 0
+
+
 commands = {
   'list': (ListJobs, ARGS_NONE,
             [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
@@ -99,7 +109,11 @@ commands = {
            " (see the man page for details): id, status, op_list,"
            " op_status, op_result."
            " The default field"
-           " list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS))
+           " list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS)),
+  'archive': (ArchiveJobs, ARGS_ANY,
+              [DEBUG_OPT],
+              "<job-id> [<job-id> ...]",
+              "Archive specified jobs"),
   }
 
 
-- 
GitLab