Skip to content

Commit

Permalink
added none check before logging statement (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
mojojojo99 authored Dec 15, 2020
1 parent de795eb commit db2cef3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions jobManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,18 @@ def __manage(self):
preVM = self.preallocator.allocVM(job.vm.name)
vmms = self.vmms[job.vm.vmms] # Create new vmms object

# Now dispatch the job to a worker
self.log.info("Dispatched job %s:%d to %s [try %d]" %
(job.name, job.id, preVM.name, job.retries))
if prevVM.name is not None:
self.log.info("Dispatched job %s:%d to %s [try %d]" %
(job.name, job.id, preVM.name, job.retries))
else:
self.log.info("Unable to pre-allocate a vm for job job %s:%d [try %d]" % (job.name, job.id, job.retries))

job.appendTrace(
"%s|Dispatched job %s:%d [try %d]" %
(datetime.utcnow().ctime(), job.name, job.id, job.retries))


# Now dispatch the job to a worker
Worker(
job,
vmms,
Expand Down

0 comments on commit db2cef3

Please sign in to comment.