Skip to content

Commit

Permalink
Fix init of RequestedJob.
Browse files Browse the repository at this point in the history
Fixing init to properly handle args passed to super init.
  • Loading branch information
robertbartel committed Mar 22, 2023
1 parent 524a89c commit f7c7ee3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/lib/scheduler/dmod/scheduler/job/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ def factory_init_from_request(cls, job_request: SchedulerRequestMessage) -> 'Req
return cls(job_request=job_request, cpu_count=job_request.cpus, memory_size=job_request.memory,
allocation_paradigm=job_request.allocation_paradigm)

def __init__(self, job_request: SchedulerRequestMessage, *args, **kwargs):
def __init__(self, job_request: SchedulerRequestMessage, **kwargs):
"""
Initialize this instance.
Expand All @@ -1382,7 +1382,14 @@ def __init__(self, job_request: SchedulerRequestMessage, *args, **kwargs):
allocation_paradigm
alloc_priority
"""
super(RequestedJob, self).__init__(model_request=job_request.model_request, *args, **kwargs)
if 'cpu_count' not in kwargs:
kwargs['cpu_count'] = job_request.cpus
if 'memory_size' not in kwargs:
kwargs['memory_size'] = job_request.memory
if 'allocation_paradigm' not in kwargs:
kwargs['allocation_paradigm'] = job_request.allocation_paradigm

super().__init__(model_request=job_request.model_request, **kwargs)
self._originating_request = job_request
self.data_requirements = job_request.model_request.data_requirements

Expand Down

0 comments on commit f7c7ee3

Please sign in to comment.