Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bin/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ MAINTAINER Waldemar Hummer (waldemar.hummer@gmail.com)
LABEL authors="Waldemar Hummer (waldemar.hummer@gmail.com)"

# install some common libs
RUN apk add --no-cache autoconf automake build-base ca-certificates curl g++ gcc git groff \
iputils libffi-dev libtool linux-headers make openssl openssl-dev python3 python3-dev \
RUN apk add --no-cache autoconf automake build-base ca-certificates curl cyrus-sasl-dev g++ gcc git \
groff iputils libffi-dev libtool linux-headers make openssl openssl-dev python3 python3-dev \
py3-pip tar xz zip && \
update-ca-certificates

Expand All @@ -31,9 +31,9 @@ RUN apk add --no-cache nss

# Install Maven - taken from official repo:
# https://github.com/carlossg/docker-maven/blob/master/jdk-8/Dockerfile)
ARG MAVEN_VERSION=3.6.2
ARG MAVEN_VERSION=3.6.3
ARG USER_HOME_DIR="/root"
ARG SHA=3fbc92d1961482d6fbd57fbf3dd6d27a4de70778528ee3fb44aa7d27eb32dfdc
ARG SHA=26ad91d751b3a9a53087aefa743f4e16a17741d3915b219cf74112bf87a438c5
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-$MAVEN_VERSION-bin.tar.gz \
Expand Down
5 changes: 3 additions & 2 deletions localstack/services/cloudformation/cloudformation_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def get_template_body(req_data):
if url:
response = run_safe(lambda: safe_requests.get(url, verify=False))
# check error codes, and code 301 - fixes https://github.com/localstack/localstack/issues/1884
if not response or response.status_code == 301 or response.status_code >= 400:
status_code = 0 if response is None else response.status_code
if not response or status_code == 301 or status_code >= 400:
# check if this is an S3 URL, then get the file directly from there
if '://localhost' in url or re.match(r'.*s3(\-website)?\.([^\.]+\.)?amazonaws.com.*', url):
parsed_path = urlparse.urlparse(url).path.lstrip('/')
Expand All @@ -111,7 +112,7 @@ def get_template_body(req_data):
result = client.get_object(Bucket=parts[0], Key=parts[2])
body = to_str(result['Body'].read())
return body
raise Exception('Unable to fetch template body (code %s) from URL %s' % (response.status_code, url))
raise Exception('Unable to fetch template body (code %s) from URL %s' % (status_code, url))
return response.content
raise Exception('Unable to get template body from input: %s' % req_data)

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ python-coveralls>=2.9.1
pyyaml>=3.13,<=5.1
requests>=2.20.0 #basic-lib
requests-aws4auth==0.9
sasl>=0.2.1
six>=1.12.0 #basic-lib
subprocess32==3.5.4 #basic-lib
xmltodict>=0.11.0