1""" 2This module contains the status enums for use by HostQueueEntrys in the 3database. It is a stand alone module as these status strings are needed 4from various disconnected pieces of code that should not depend on everything 5that frontend.afe.models depends on such as RPC clients. 6""" 7 8from autotest_lib.client.common_lib import autotest_enum 9 10Status_list = ['Queued', 'Starting', 'Resetting', 'Verifying', 'Provisioning', 11 'Pending', 'Running', 'Gathering', 'Parsing', 12 'Aborted', 'Completed', 'Failed', 'Stopped', 13 'Cleaning', 'Template'] 14 15Status = autotest_enum.AutotestEnum(*Status_list, string_values=True) 16ACTIVE_STATUSES = (Status.STARTING, Status.RESETTING, Status.VERIFYING, 17 Status.PROVISIONING, Status.PENDING, Status.RUNNING, 18 Status.GATHERING, Status.CLEANING) 19COMPLETE_STATUSES = (Status.ABORTED, Status.COMPLETED, Status.FAILED, 20 Status.STOPPED, Status.TEMPLATE) 21# A state cannot both be active and complete 22assert not set(ACTIVE_STATUSES) & set(COMPLETE_STATUSES) 23PRE_JOB_STATUSES = (Status.RESETTING, Status.PROVISIONING, Status.VERIFYING, 24 Status.PENDING, Status.QUEUED) 25IDLE_PRE_JOB_STATUSES = (Status.PENDING, Status.QUEUED) 26 27IntStatus = autotest_enum.AutotestEnum(*Status_list) 28