1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.3 KiB

"""
This module contains the status enums for use by HostQueueEntrys in the
database. It is a stand alone module as these status strings are needed
from various disconnected pieces of code that should not depend on everything
that frontend.afe.models depends on such as RPC clients.
"""
from autotest_lib.client.common_lib import autotest_enum
Status_list = ['Queued', 'Starting', 'Resetting', 'Verifying', 'Provisioning',
'Pending', 'Running', 'Gathering', 'Parsing',
'Aborted', 'Completed', 'Failed', 'Stopped',
'Cleaning', 'Template']
Status = autotest_enum.AutotestEnum(*Status_list, string_values=True)
ACTIVE_STATUSES = (Status.STARTING, Status.RESETTING, Status.VERIFYING,
Status.PROVISIONING, Status.PENDING, Status.RUNNING,
Status.GATHERING, Status.CLEANING)
COMPLETE_STATUSES = (Status.ABORTED, Status.COMPLETED, Status.FAILED,
Status.STOPPED, Status.TEMPLATE)
# A state cannot both be active and complete
assert not set(ACTIVE_STATUSES) & set(COMPLETE_STATUSES)
PRE_JOB_STATUSES = (Status.RESETTING, Status.PROVISIONING, Status.VERIFYING,
Status.PENDING, Status.QUEUED)
IDLE_PRE_JOB_STATUSES = (Status.PENDING, Status.QUEUED)
IntStatus = autotest_enum.AutotestEnum(*Status_list)