Skip to content

Commit

Permalink
Lambda execute stack trace should be not formatted with extra space (#…
Browse files Browse the repository at this point in the history
…1615)

Lambda execute stack trace should be not formatted with extra space

SUMMARY

Fixes #1497
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

plugins/modules/lambda_execute.py
ADDITIONAL INFORMATION

Reviewed-by: Jill R
Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
Reviewed-by: Mike Graves <[email protected]>
(cherry picked from commit 271523e)
  • Loading branch information
taehopark32 authored and patchback[bot] committed Jun 27, 2023
1 parent 9ed1e88 commit 7f33fca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/1615-no_formatted_with_extra_space.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Fixes to the stack trace output, where it does not contain spaces between each character. The module had incorrectly always outputted extra spaces between each character. (https://github.com/ansible-collections/amazon.aws/pull/1615)
8 changes: 2 additions & 6 deletions plugins/modules/lambda_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,10 @@ def main():
"Function executed, but there was an error in the Lambda function. "
"Message: {errmsg}, Type: {type}, Stack Trace: {trace}"
)

error_data = {
# format the stacktrace sent back as an array into a multiline string
"trace": "\n".join(
[
" ".join([str(x) for x in line]) # cast line numbers to strings
for line in results.get("output", {}).get("stackTrace", [])
]
),
"trace": "\n".join(results.get("output", {}).get("stackTrace", [])),
"errmsg": results["output"].get("errorMessage"),
"type": results["output"].get("errorType"),
}
Expand Down

0 comments on commit 7f33fca

Please sign in to comment.