correction d'un bug introduit dans le commit 2034 (je crois) : les slots sont désormais par queuemachine, et non pas machine

This commit is contained in:
Guillaume Raffy 2012-06-28 12:11:21 +00:00
parent 319c78dd86
commit 265aac6064
1 changed files with 5 additions and 3 deletions

View File

@ -27,7 +27,9 @@ class JobsState:
def getJobsOnMachine( self, machineName ):
jobsOnMachine = {}
for jobId, job in self.m_jobs.iteritems():
if job.getSlots().get(machineName):
for queueMachineName, numSlots in job.getSlots().iteritems():
jobMachineName = queueMachineName.split('@')[1]
if jobMachineName == machineName:
jobsOnMachine[ jobId ] = job
return jobsOnMachine
@ -35,7 +37,7 @@ class JobsState:
#logInfo('getNumFreeSlotsOnQueueMachine : looking for free slots on queuemachine %s' % queueMachine.getName() )
numUsedSlots = 0
for job in self.m_jobs.itervalues():
numUsedSlotsByThisJob = job.getSlots().get( queueMachine.getMachineName() )
numUsedSlotsByThisJob = job.getSlots().get( queueMachine.getName() )
if numUsedSlotsByThisJob != None:
#logInfo('getNumFreeSlotsOnQueueMachine : job %d uses %d slots' % (job.getId().asStr(), numUsedSlotsByThisJob) )
numUsedSlots += numUsedSlotsByThisJob