trestle.tasks.base_task
trestle.tasks.base_task ¤
Trestle tasks base templating.
Attributes¤
logger = logging.getLogger(__name__) module-attribute ¤
Classes¤
PassFail ¤
Bases: TaskBase
flowchart TD
trestle.tasks.base_task.PassFail[PassFail]
trestle.tasks.base_task.TaskBase[TaskBase]
trestle.tasks.base_task.TaskBase --> trestle.tasks.base_task.PassFail
click trestle.tasks.base_task.PassFail href "" "trestle.tasks.base_task.PassFail"
click trestle.tasks.base_task.TaskBase href "" "trestle.tasks.base_task.TaskBase"
Holding pattern template for a task which does nothing and always passes.
Attributes:
| Name | Type | Description |
|---|---|---|
name | Name of the task. |
Source code in trestle/tasks/base_task.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
Attributes¤
name = 'pass-fail' class-attribute instance-attribute ¤
Methods:¤
__init__(config_object) ¤
Initialize trestle task pass-fail.
Attributes:
| Name | Type | Description |
|---|---|---|
config_object | Config section associated with the task. |
Source code in trestle/tasks/base_task.py
114 115 116 117 118 119 120 121 | |
execute() ¤
Provide a actual outcome.
Source code in trestle/tasks/base_task.py
145 146 147 148 149 150 151 | |
print_info() ¤
Print the help string.
Source code in trestle/tasks/base_task.py
123 124 125 126 127 128 129 130 131 132 133 134 135 | |
simulate() ¤
Provide a simulated outcome.
Source code in trestle/tasks/base_task.py
137 138 139 140 141 142 143 | |
TaskBase ¤
Bases: ABC
flowchart TD
trestle.tasks.base_task.TaskBase[TaskBase]
click trestle.tasks.base_task.TaskBase href "" "trestle.tasks.base_task.TaskBase"
Abstract base class for tasks.
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Name of the task. |
Source code in trestle/tasks/base_task.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
Attributes¤
name = 'base' class-attribute instance-attribute ¤
Methods:¤
__init__(config_object) ¤
Initialize task base and store config.
Source code in trestle/tasks/base_task.py
51 52 53 | |
execute() abstractmethod ¤
Execute the task including potential rollback.
Source code in trestle/tasks/base_task.py
95 96 97 | |
print_info() abstractmethod ¤
Print the help string.
Source code in trestle/tasks/base_task.py
91 92 93 | |
simulate() abstractmethod ¤
Simulate the task and report task outcome.
Source code in trestle/tasks/base_task.py
99 100 101 | |
TaskOutcome ¤
Bases: Enum
flowchart TD
trestle.tasks.base_task.TaskOutcome[TaskOutcome]
click trestle.tasks.base_task.TaskOutcome href "" "trestle.tasks.base_task.TaskOutcome"
Enum describing possible task outcomes.
Source code in trestle/tasks/base_task.py
30 31 32 33 34 35 36 37 38 | |
Attributes¤
FAILURE = 'failure' class-attribute instance-attribute ¤
NOT_IMPLEMENTED = 'not-implemented' class-attribute instance-attribute ¤
ROLLEDBACK = 'rolledback' class-attribute instance-attribute ¤
SIM_FAILURE = 'simulated-failure' class-attribute instance-attribute ¤
SIM_SUCCESS = 'simulated-success' class-attribute instance-attribute ¤
SUCCESS = 'success' class-attribute instance-attribute ¤
handler: python