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) (#1628)

[PR #1615/271523ea backport][stable-6] Lambda execute stack trace should be not formatted with extra space

This is a backport of PR #1615 as merged into main (271523e).
SUMMARY


Fixes #1497
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

plugins/modules/lambda_execute.py
ADDITIONAL INFORMATION

Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Alina Buzachis
  • Loading branch information
patchback[bot] authored Jul 3, 2023
1 parent 61ab735 commit 67eea8c
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 67eea8c

Please sign in to comment.