From b27b39b001a56322475499dffa7321f6004221c2 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 30 Sep 2008 12:22:13 +0000
Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=98gnt-job=20info=E2=80=99=20with?=
 =?UTF-8?q?=20no=20arguments?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

I didn't realize that my zip will break when no args are passed...

Reviewed-by: imsnah
---
 scripts/gnt-job | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/gnt-job b/scripts/gnt-job
index 3c831be77..bb3e0543b 100755
--- a/scripts/gnt-job
+++ b/scripts/gnt-job
@@ -149,14 +149,19 @@ def ShowJobs(opts, args):
 
   first = True
 
-  for entry, arg_job in zip(result, args):
+  for idx, entry in enumerate(result):
     if not first:
       format(0, "")
     else:
       first = False
 
     if entry is None:
-      format(0, "Job ID %s not found" % arg_job)
+      if idx <= len(args):
+        format(0, "Job ID %s not found" % args[idx])
+      else:
+        # this should not happen, when we don't pass args it will be a
+        # valid job returned
+        format(0, "Job ID requested as argument %s not found" % (idx + 1))
       continue
 
     (job_id, status, ops, opresult, opstatus, oplog,
-- 
GitLab