Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2139 use shlex to split management args #2152

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
9 changes: 7 additions & 2 deletions zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,12 @@ def create_handler_venv(self):
pip_return_code = pip_process.returncode

if pip_return_code:
raise EnvironmentError("Pypi lookup failed")
output = pip_process.stdout
if hasattr(output, 'decode'):
output = output.decode('utf-8')
raise EnvironmentError(
"Pypi lookup failed\n{}".format(output)
)

return ve_path

Expand Down Expand Up @@ -2135,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 = {}

Expand Down
3 changes: 2 additions & 1 deletion zappa/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import logging
import os
import shlex
import sys
import traceback
import tarfile
Expand Down Expand Up @@ -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.
Expand Down