Make SubmitOpCode expect options without print_jobid
authorKlaus Aehlig <aehlig@google.com>
Tue, 11 Jun 2013 08:24:47 +0000 (10:24 +0200)
committerKlaus Aehlig <aehlig@google.com>
Tue, 11 Jun 2013 10:55:12 +0000 (12:55 +0200)
As opposed to SubmitOrSend, the SubmitOpCode function is
called also by commands not supporting submit options. Hence
only inspect these options, if they are actually present.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

lib/cli.py

index 062c24b..2e436b6 100644 (file)
@@ -2263,7 +2263,7 @@ def SubmitOpCode(op, cl=None, feedback_fn=None, opts=None, reporter=None):
   SetGenericOpcodeOpts([op], opts)
 
   job_id = SendJob([op], cl=cl)
-  if opts.print_jobid:
+  if hasattr(opts, "print_jobid") and opts.print_jobid:
     ToStdout("%d" % job_id)
 
   op_results = PollJob(job_id, cl=cl, feedback_fn=feedback_fn,