diff --git a/changelogs/fragments/1615-no_formatted_with_extra_space.yml b/changelogs/fragments/1615-no_formatted_with_extra_space.yml new file mode 100644 index 0000000000..693362b695 --- /dev/null +++ b/changelogs/fragments/1615-no_formatted_with_extra_space.yml @@ -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) \ No newline at end of file diff --git a/plugins/modules/lambda_execute.py b/plugins/modules/lambda_execute.py index 7f4b7aea10..10d38d1f59 100644 --- a/plugins/modules/lambda_execute.py +++ b/plugins/modules/lambda_execute.py @@ -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"), }