Commit 798ebc98 authored by MOMMESSIN Clement's avatar MOMMESSIN Clement
Browse files

Add return value for register_job + small comment

The function register_job now returns the Job that was created
parent 4588a2da
...@@ -227,6 +227,7 @@ class Batsim(object): ...@@ -227,6 +227,7 @@ class Batsim(object):
walltime, walltime,
profile_name, profile_name,
subtime=None): subtime=None):
""" Returns the registered Job """
if subtime is None: if subtime is None:
subtime = self.time() subtime = self.time()
...@@ -249,6 +250,7 @@ class Batsim(object): ...@@ -249,6 +250,7 @@ class Batsim(object):
self.jobs[id] = Job.from_json_dict(job_dict) self.jobs[id] = Job.from_json_dict(job_dict)
self.jobs[id].job_state = Job.State.IN_SUBMISSON self.jobs[id].job_state = Job.State.IN_SUBMISSON
self.nb_jobs_in_submission = self.nb_jobs_in_submission + 1 self.nb_jobs_in_submission = self.nb_jobs_in_submission + 1
return self.jobs[id]
def set_resource_state(self, resources, state): def set_resource_state(self, resources, state):
""" args:resources: is a ProcSet containing a list of resources. """ args:resources: is a ProcSet containing a list of resources.
...@@ -280,7 +282,7 @@ class Batsim(object): ...@@ -280,7 +282,7 @@ class Batsim(object):
return job, profile return job, profile
def request_consumed_energy(self): #TODO CHANGE NAME def request_consumed_energy(self): #TODO CHANGE NAME
self._events_to_send.append( self._events_to_send.append(
{ {
"timestamp": self.time(), "timestamp": self.time(),
......
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