Add jobs in Paused state to the list of unfinished jobs
Currently, get_unfinished_jobs() returns jobs in Running and Scheduled states but not Paused state. This causes problems, because a job in Paused state will still block more instances of the same job from being created. This change adds jobs in Paused state to this function's output. It also migrates states indicating that job hasn't finished to a constant. Change-Id: I617b7427704aba7bc6cbaa4384906598f9d4e408
This commit is contained in:
parent
34b96be03b
commit
d8dc61bc1c
@ -15,3 +15,6 @@
|
||||
IDRAC_CONFIG_PENDING = 'LC068'
|
||||
IDRAC_JOB_RUNNING = 'RAC0679'
|
||||
NO_FOREIGN_CONFIG = 'STOR018'
|
||||
INCOMPLETE_JOB_STATES = ['Scheduled',
|
||||
'Running',
|
||||
'Paused']
|
||||
|
@ -16,6 +16,8 @@ import logging
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from sushy_oem_idrac import constants
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -49,8 +51,7 @@ class DellJobCollection(base.ResourceBase):
|
||||
job_response = self._conn.get(job_expand_uri)
|
||||
data = job_response.json()
|
||||
for job in data[u'Members']:
|
||||
if ((job[u'JobState'] == 'Scheduled') or (
|
||||
job[u'JobState'] == 'Running')):
|
||||
if job[u'JobState'] in constants.INCOMPLETE_JOB_STATES:
|
||||
unfinished_jobs.append(job['Id'])
|
||||
LOG.info('Got unfinished jobs')
|
||||
return unfinished_jobs
|
||||
|
Loading…
Reference in New Issue
Block a user