Fixed typo

This commit is contained in:
Terry Cain 2017-10-25 20:14:39 +01:00
parent 62a2d8f756
commit 596bf84480
No known key found for this signature in database
GPG Key ID: 14D90844E4E9B9F3
2 changed files with 3 additions and 23 deletions

View File

@ -12,24 +12,6 @@ except:
from moto.core.utils import amz_crc32, amzn_request_id
from moto.core.responses import BaseResponse
import signal
import contextlib
@contextlib.contextmanager
def timeout(seconds=5):
def handle_error(signum, frame):
raise RuntimeError()
try:
signal.signal(signal.SIGALRM, handle_error)
signal.alarm(seconds)
yield None
except RuntimeError:
pass
finally:
signal.alarm(0)
class LambdaResponse(BaseResponse):
@ -118,8 +100,7 @@ class LambdaResponse(BaseResponse):
if lambda_backend.has_function(function_name):
fn = lambda_backend.get_function(function_name)
with timeout(seconds=360):
payload = fn.invoke(self.body, self.headers, response_headers)
payload = fn.invoke(self.body, self.headers, response_headers)
response_headers['Content-Length'] = str(len(payload))
return 202, response_headers, payload
else:
@ -133,8 +114,7 @@ class LambdaResponse(BaseResponse):
function_name = path.split('/')[-3]
if lambda_backend.has_function(function_name):
fn = lambda_backend.get_function(function_name)
with timeout(seconds=360):
fn.invoke(self.body, self.headers, response_headers)
fn.invoke(self.body, self.headers, response_headers)
response_headers['Content-Length'] = str(0)
return 202, response_headers, ""
else:

View File

@ -704,7 +704,7 @@ class RDS2Backend(BaseBackend):
if self.arn_regex.match(source_database_id):
db_kwargs['region'] = self.region
# Shoudln't really copy here as the instance is duplicated. RDS replicas have different instances.
# Shouldn't really copy here as the instance is duplicated. RDS replicas have different instances.
replica = copy.copy(primary)
replica.update(db_kwargs)
replica.set_as_replica()