masterd: Remove duplicate code
authorMichael Hanselmann <hansmi@google.com>
Mon, 10 Dec 2012 14:30:32 +0000 (15:30 +0100)
committerMichael Hanselmann <hansmi@google.com>
Mon, 10 Dec 2012 14:47:51 +0000 (15:47 +0100)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/server/masterd.py

index 1ef5480..9ca39e6 100644 (file)
@@ -71,12 +71,13 @@ def _LogNewJob(status, info, ops):
   """Log information about a recently submitted job.
 
   """
+  op_summary = utils.CommaJoin(op.Summary() for op in ops)
+
   if status:
-    logging.info("New job with id %s, summary: %s",
-                 info, utils.CommaJoin(op.Summary() for op in ops))
+    logging.info("New job with id %s, summary: %s", info, op_summary)
   else:
     logging.info("Failed to submit job, reason: '%s', summary: %s",
-                 info, utils.CommaJoin(op.Summary() for op in ops))
+                 info, op_summary)
 
 
 class ClientRequestWorker(workerpool.BaseWorker):