Merge "Add jobs in Paused state to the list of unfinished jobs"
This commit is contained in:
commit
f304f34d48
@ -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__)
|
||||
|
||||
|
||||
@ -48,8 +50,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…
x
Reference in New Issue
Block a user