Commit 205d71fd authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix logging with string job IDs

The job ID is now a string, hence logging must use %s instead of %d.

Reviewed-by: iustinp
parent dca1764e
...@@ -415,7 +415,7 @@ class JobStorage(object): ...@@ -415,7 +415,7 @@ class JobStorage(object):
assert self.lock_fd, "Queue should be open" assert self.lock_fd, "Queue should be open"
if job_id in self._memcache: if job_id in self._memcache:
logging.debug("Found job %d in memcache", job_id) logging.debug("Found job %s in memcache", job_id)
return self._memcache[job_id] return self._memcache[job_id]
filepath = self._GetJobPath(job_id) filepath = self._GetJobPath(job_id)
...@@ -433,7 +433,7 @@ class JobStorage(object): ...@@ -433,7 +433,7 @@ class JobStorage(object):
job = _QueuedJob.Restore(self, data) job = _QueuedJob.Restore(self, data)
self._memcache[job_id] = job self._memcache[job_id] = job
logging.debug("Added job %d to the cache", job_id) logging.debug("Added job %s to the cache", job_id)
return job return job
def _GetJobsUnlocked(self, job_ids): def _GetJobsUnlocked(self, job_ids):
...@@ -451,7 +451,7 @@ class JobStorage(object): ...@@ -451,7 +451,7 @@ class JobStorage(object):
"""Create and store on disk a new job. """Create and store on disk a new job.
@type ops: list @type ops: list
@param ops: The list of OpCodes that will becom the new job. @param ops: The list of OpCodes that will become the new job.
@type nodes: list @type nodes: list
@param nodes: The list of nodes to which the new job serial will be @param nodes: The list of nodes to which the new job serial will be
distributed. distributed.
...@@ -466,7 +466,7 @@ class JobStorage(object): ...@@ -466,7 +466,7 @@ class JobStorage(object):
# Write to disk # Write to disk
self._UpdateJobUnlocked(job) self._UpdateJobUnlocked(job)
logging.debug("Added new job %d to the cache", job_id) logging.debug("Added new job %s to the cache", job_id)
self._memcache[job_id] = job self._memcache[job_id] = job
return job return job
...@@ -493,7 +493,7 @@ class JobStorage(object): ...@@ -493,7 +493,7 @@ class JobStorage(object):
continue continue
if job.GetStatus() not in (constants.JOB_STATUS_QUEUED, if job.GetStatus() not in (constants.JOB_STATUS_QUEUED,
constants.JOB_STATUS_RUNNING): constants.JOB_STATUS_RUNNING):
logging.debug("Cleaning job %d from the cache", job.id) logging.debug("Cleaning job %s from the cache", job.id)
try: try:
del self._memcache[job.id] del self._memcache[job.id]
except KeyError: except KeyError:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment