If using newer dynamodb api, use version 2.
This commit is contained in:
parent
1068e26e66
commit
cdd6e476cc
@ -62,8 +62,14 @@ class DomainDispatcherApplication(object):
|
||||
except ValueError:
|
||||
region = 'us-east-1'
|
||||
service = 's3'
|
||||
host = "{service}.{region}.amazonaws.com".format(
|
||||
service=service, region=region)
|
||||
if service == 'dynamodb':
|
||||
dynamo_api_version = environ['HTTP_X_AMZ_TARGET'].split("_")[1].split(".")[0]
|
||||
# If Newer API version, use dynamodb2
|
||||
if dynamo_api_version > "20111205":
|
||||
host = "dynamodb2"
|
||||
else:
|
||||
host = "{service}.{region}.amazonaws.com".format(
|
||||
service=service, region=region)
|
||||
|
||||
with self.lock:
|
||||
backend = self.get_backend_for_host(host)
|
||||
|
Loading…
Reference in New Issue
Block a user