Skip to content

Commit 39f423f

Browse files
Remove non-UTF-8 data from module output (#2386) (#2442)
This is a backport of PR #2386 as merged into main (a39b3e0). SUMMARY Fixes #2307. Ansible previously generated warning is module output contained non UTF-8 data. Starting with version 2.18, it now throws an error, which prevents successful execution of lambda module. ISSUE TYPE Bugfix Pull Request COMPONENT NAME lambda ADDITIONAL INFORMATION Reviewed-by: Helen Bailey <[email protected]> Reviewed-by: Mandar Kulkarni <[email protected]>
1 parent 09b44e3 commit 39f423f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- lambda - Remove non UTF-8 data (contents of Lambda ZIP file) from the module output to avoid Ansible error (https://github.com/ansible-collections/amazon.aws/issues/2386).

plugins/modules/lambda.py

+3
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,9 @@ def main():
808808
module.fail_json(msg="Unable to get function information after updating")
809809
response = format_response(response)
810810
# We're done
811+
# "ZipFile" attribute contains non UTF-8 data. Ansible considers it an error
812+
# starting with version 2.18. Removing it from the output avoids the error.
813+
code_kwargs.pop("ZipFile", None)
811814
module.exit_json(changed=changed, code_kwargs=code_kwargs, func_kwargs=func_kwargs, **response)
812815

813816
# Function doesn't exist, create new Lambda function

0 commit comments

Comments
 (0)