From 68c298997488a274a4c44aeb8e54d6b4e9d538b7 Mon Sep 17 00:00:00 2001 From: Jared Hobbs Date: Tue, 11 Aug 2020 15:28:05 -0600 Subject: [PATCH 1/5] fix: use shlex to split management args fixes https://github.com/Miserlou/Zappa/issues/2139 --- zappa/handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zappa/handler.py b/zappa/handler.py index 78a31cfda..602380f8b 100644 --- a/zappa/handler.py +++ b/zappa/handler.py @@ -7,6 +7,7 @@ import json import logging import os +import shlex import sys import traceback import tarfile @@ -405,7 +406,7 @@ def handler(self, event, context): # Couldn't figure out how to get the value into stdout with StringIO.. # Read the log for now. :[] - management.call_command(*event['manage'].split(' ')) + management.call_command(shlex.split(*event['manage'])) return {} # This is an AWS-event triggered invocation. From 0c9a1c6568d4eb6ae30a3aae769dcf2b0b361791 Mon Sep 17 00:00:00 2001 From: Jared Hobbs Date: Tue, 11 Aug 2020 15:54:08 -0600 Subject: [PATCH 2/5] fix: typo --- zappa/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zappa/handler.py b/zappa/handler.py index 602380f8b..4de71716b 100644 --- a/zappa/handler.py +++ b/zappa/handler.py @@ -406,7 +406,7 @@ def handler(self, event, context): # Couldn't figure out how to get the value into stdout with StringIO.. # Read the log for now. :[] - management.call_command(shlex.split(*event['manage'])) + management.call_command(*shlex.split(event['manage'])) return {} # This is an AWS-event triggered invocation. From eef802859a2eb2b1b071e4afbe6c15e6048fb0d1 Mon Sep 17 00:00:00 2001 From: Jared Hobbs Date: Tue, 1 Dec 2020 14:13:03 -0700 Subject: [PATCH 3/5] add output when pip install fails --- zappa/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zappa/core.py b/zappa/core.py index 2798ae786..fdb69442c 100644 --- a/zappa/core.py +++ b/zappa/core.py @@ -437,7 +437,9 @@ def create_handler_venv(self): pip_return_code = pip_process.returncode if pip_return_code: - raise EnvironmentError("Pypi lookup failed") + raise EnvironmentError( + "Pypi lookup failed\n{}".format(pip_process.stdout.decode('utf-8')) + ) return ve_path From 931970470ee4ab74d2cd316be8509c0dc72040a7 Mon Sep 17 00:00:00 2001 From: Jared Hobbs Date: Mon, 11 Jan 2021 18:14:32 -0700 Subject: [PATCH 4/5] Only decode if necessary --- zappa/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zappa/core.py b/zappa/core.py index fdb69442c..26305abd6 100644 --- a/zappa/core.py +++ b/zappa/core.py @@ -437,8 +437,11 @@ def create_handler_venv(self): pip_return_code = pip_process.returncode if pip_return_code: + output = pip_process.stdout + if hasattr(output, 'decode'): + output = output.decode('utf-8') raise EnvironmentError( - "Pypi lookup failed\n{}".format(pip_process.stdout.decode('utf-8')) + "Pypi lookup failed\n{}".format(output) ) return ve_path From 2d1fb8be758b4a39f37fae91bf8f4a28a15efa7a Mon Sep 17 00:00:00 2001 From: Shawna Date: Tue, 6 Jul 2021 11:37:55 -0500 Subject: [PATCH 5/5] Update core.py --- zappa/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zappa/core.py b/zappa/core.py index 26305abd6..4b4be50b6 100644 --- a/zappa/core.py +++ b/zappa/core.py @@ -2140,7 +2140,7 @@ def create_stack_template( self, # build a fresh template self.cf_template = troposphere.Template() - self.cf_template.add_description('Automatically generated with Zappa') + self.cf_template.set_description('Automatically generated with Zappa') self.cf_api_resources = [] self.cf_parameters = {}