bug fix for output_value[output_key] is not iterable#5309
bug fix for output_value[output_key] is not iterable#5309cognifloyd merged 9 commits intoStackStorm:masterfrom
output_value[output_key] is not iterable#5309Conversation
if output_value[output_key] is not iterable and instead a boolean I receive the following error code from the st2api.
IE:
```
output_value: {'stdout': '', 'stderr': '', 'exit_code': 0, 'result': True}
spec: {'status': 'bool'}
key: output
output_key: result
```
ERROR:
```
ERROR: 500 Server Error: Internal Server Error
MESSAGE: Internal Server Error for url: https://stackstorm-vf.ifp.lmco.com/api/executions/60f94708c3a6d1a338dc0ad7/children/?depth=-1
```
|
This would probably also apply to int, float, and other types that are not |
|
Works for me.
…On Thu, Jul 22, 2021, 11:28 AM Jacob Floyd ***@***.***> wrote:
This would probably also apply to int, float, and other types that are not
Collections.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5309 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ5TIL6BJQOVDERVX6Y6W3TZA2KJANCNFSM5AZ62MYA>
.
|
switch to using Collection instead of bool check Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
add import collections
whitespace fix
m4dcoder
left a comment
There was a problem hiding this comment.
Can you add a unit test that reproduce this issue so we know this patch is going to fix?
|
Hmm. So there were two issues: 1) the bug you found. 2) your spec is not well formed. Instead of this spec: You need this jsonschema spec: I'm looking at how to adjust the tests now. |
|
K. I added #5319 based on this. |
|
Where did we leave this? |
|
I have too many irons in the fire. I can't work on this for now. I'll come back to it when I can shift focus. |
|
@guzzijones add changelog entry. |
cognifloyd
left a comment
There was a problem hiding this comment.
OK. I added a changelog entry that mentions that output_schema handling will change in a future release.
I also adjusted bailing out early if the output value is not an object or if a spec in output_schema is mal-formed.
I think this is ready to merge.
m4dcoder
left a comment
There was a problem hiding this comment.
Conditional approve. The proper fix will be followed up in v3.7.
|
Yes. I will rework/expand #5319 before 3.7.0. |
if output_value[output_key] is not iterable and instead a boolean I receive the following error code from the st2api.
IE:
ERROR: