Mistral Workflows should validate their inputs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Many of the workflows accept inputs, but if they are changed from the defaults and don't match what is expected they can fail in obscure ways.
We could work around this with a custom action that validates inputs. It would then be used at the start of workflows to validate the inputs as the first task. It could look something like this...
tasks:
validate_inputs:
action: tripleo.
input:
task_context: <% $ %>
types:
queue_name: string
container: plan_name
timeout: integer
on-success: original_
This would verify that the queue_name, container and timeout inputs. The "types" (string, plan_name and integer) would need to be known names in the action which would map to a validating function/regex.
The action could look something like this...
validators = {
"plan_name": validating_
...
}
class ValidateInputs(
def __input__(self, task_context, types):
self.types = types
def run(self, context):
for name, type in self.types.items():
value = self.task_
assert validators[
Changed in tripleo: | |
status: | Confirmed → Triaged |
milestone: | none → rocky-2 |
Changed in tripleo: | |
milestone: | rocky-2 → rocky-3 |
Changed in tripleo: | |
milestone: | rocky-3 → rocky-rc1 |
Changed in tripleo: | |
milestone: | rocky-rc1 → stein-1 |
I think it makes more sense to try and solve this more generally in Mistral.