Merge "Add jobs in Paused state to the list of unfinished jobs"

This commit is contained in:
Zuul 2024-04-02 15:01:15 +00:00 committed by Gerrit Code Review
commit f304f34d48
2 changed files with 6 additions and 2 deletions

View File

@ -15,3 +15,6 @@
IDRAC_CONFIG_PENDING = 'LC068'
IDRAC_JOB_RUNNING = 'RAC0679'
NO_FOREIGN_CONFIG = 'STOR018'
INCOMPLETE_JOB_STATES = ['Scheduled',
'Running',
'Paused']

View File

@ -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