Nested AdHoc actions do not process all input defaults or output transformations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mistral |
Fix Released
|
High
|
Bob Haddleton |
Bug Description
When using nested AdHoc Actions that use output transformations, the input defaults for the nested actions are not processed, and the action result is only being transformed by the output of the action that is being called. Output transformations in nested actions are not processed.
For example:
actions:
concat_twice:
base: std.echo
base-input:
output: "<% $.s1 %>+<% $.s2 %>"
input:
- s1: "a"
- s2
output: "<% $ %> and <% $ %>"
nested_concat:
base: my_wb.concat_twice
base-input:
s2: '{{ _.n2 }}'
input:
- n2: 'b'
output:
nested_
If concat_twice is called with s2='b', the output is "a+b and a+b"
So the expected output from nested_concat would be {"nested_concat": "a+b and a+b"}
But since the input defaults of concat_twice are not processed, and the output transform of the called action is the only one that is executed, the output transform in the concat_twice action is skipped and the output is:
{"nested_concat": "+b"}
The input defaults for each nested action can be processed in the existing traversal of nested action specs in _prepare_input(), instead of just processing the called action.
The output transformations can be processed with the same traversal of nested actions in the _prepare_output() method that is already being done in the _prepare_input() method, except that the order is reversed so that the base action output transform is processed first, and the called action output transform is called last.
def _prepare_
# In case of error, we don't transform a result.
if not result.is_error():
for action_def in reversed(
if transformer is not None:
return result
Changed in mistral: | |
assignee: | nobody → Bob Haddleton (bob-haddleton) |
status: | New → In Progress |
description: | updated |
summary: |
- Nested AdHoc actions do not process all output transformations + Nested AdHoc actions do not process all input defaults or output + transformations |
Changed in mistral: | |
milestone: | none → pike-rc2 |
importance: | Undecided → Medium |
importance: | Medium → High |
Fix proposed to branch: master /review. openstack. org/494749
Review: https:/