Introduce more configuration consistency checks
[ganeti-local] / lib / jqueue.py
index 25eb3d9..4b9f86d 100644 (file)
@@ -344,7 +344,7 @@ class _JobQueueWorker(workerpool.BaseWorker):
     @param job: the job to be processed
 
     """
-    logging.debug("Worker %s processing job %s",
+    logging.info("Worker %s processing job %s",
                   self.worker_id, job.id)
     proc = mcpu.Processor(self.pool.queue.context)
     self.queue = queue = job.queue
@@ -352,8 +352,10 @@ class _JobQueueWorker(workerpool.BaseWorker):
       try:
         count = len(job.ops)
         for idx, op in enumerate(job.ops):
+          op_summary = op.input.Summary()
           try:
-            logging.debug("Op %s/%s: Starting %s", idx + 1, count, op)
+            logging.info("Op %s/%s: Starting opcode %s", idx + 1, count,
+                         op_summary)
 
             queue.acquire()
             try:
@@ -408,8 +410,8 @@ class _JobQueueWorker(workerpool.BaseWorker):
             finally:
               queue.release()
 
-            logging.debug("Op %s/%s: Successfully finished %s",
-                          idx + 1, count, op)
+            logging.info("Op %s/%s: Successfully finished opcode %s",
+                         idx + 1, count, op_summary)
           except CancelJob:
             # Will be handled further up
             raise
@@ -420,7 +422,8 @@ class _JobQueueWorker(workerpool.BaseWorker):
                 op.status = constants.OP_STATUS_ERROR
                 op.result = str(err)
                 op.end_timestamp = TimeStampNow()
-                logging.debug("Op %s/%s: Error in %s", idx + 1, count, op)
+                logging.info("Op %s/%s: Error in opcode %s", idx + 1, count,
+                             op_summary)
               finally:
                 queue.UpdateJobUnlocked(job)
             finally:
@@ -449,8 +452,8 @@ class _JobQueueWorker(workerpool.BaseWorker):
           status = job.CalcStatus()
       finally:
         queue.release()
-      logging.debug("Worker %s finished job %s, status = %s",
-                    self.worker_id, job_id, status)
+      logging.info("Worker %s finished job %s, status = %s",
+                   self.worker_id, job_id, status)
 
 
 class _JobQueueWorkerPool(workerpool.WorkerPool):
@@ -713,13 +716,14 @@ class JobQueue(object):
     @param rename: List containing tuples mapping old to new names
 
     """
+    # Rename them locally
     for old, new in rename:
       utils.RenameFile(old, new, mkdir=True)
 
-      names, addrs = self._GetNodeIp()
-      result = rpc.RpcRunner.call_jobqueue_rename(names, addrs, old, new)
-      self._CheckRpcResult(result, self._nodes,
-                           "Moving %s to %s" % (old, new))
+    # ... and on all nodes
+    names, addrs = self._GetNodeIp()
+    result = rpc.RpcRunner.call_jobqueue_rename(names, addrs, rename)
+    self._CheckRpcResult(result, self._nodes, "Renaming files (%r)" % rename)
 
   def _FormatJobID(self, job_id):
     """Convert a job ID to string format.
@@ -1126,7 +1130,7 @@ class JobQueue(object):
     """Archives jobs.
 
     @type jobs: list of L{_QueuedJob}
-    @param job: Job objects
+    @param jobs: Job objects
     @rtype: int
     @return: Number of archived jobs
 
@@ -1159,7 +1163,7 @@ class JobQueue(object):
   def ArchiveJob(self, job_id):
     """Archives a job.
 
-    This is just a wrapper over L{_ArchiveJobUnlocked}.
+    This is just a wrapper over L{_ArchiveJobsUnlocked}.
 
     @type job_id: string
     @param job_id: Job ID of job to be archived.