Fix test failures in server mode
This commit is contained in:
parent
9d190aa04e
commit
e7b01292e9
@ -174,7 +174,11 @@ class DynamoHandler(BaseResponse):
|
|||||||
throughput = self.body["ProvisionedThroughput"]
|
throughput = self.body["ProvisionedThroughput"]
|
||||||
table = self.dynamodb_backend.update_table_throughput(name, throughput)
|
table = self.dynamodb_backend.update_table_throughput(name, throughput)
|
||||||
if 'StreamSpecification' in self.body:
|
if 'StreamSpecification' in self.body:
|
||||||
table = self.dynamodb_backend.update_table_streams(name, self.body['StreamSpecification'])
|
try:
|
||||||
|
table = self.dynamodb_backend.update_table_streams(name, self.body['StreamSpecification'])
|
||||||
|
except ValueError:
|
||||||
|
er = 'com.amazonaws.dynamodb.v20111205#ResourceInUseException'
|
||||||
|
return self.error(er, 'Cannot enable stream')
|
||||||
|
|
||||||
return dynamo_json_dump(table.describe())
|
return dynamo_json_dump(table.describe())
|
||||||
|
|
||||||
|
@ -80,10 +80,13 @@ class DomainDispatcherApplication(object):
|
|||||||
|
|
||||||
region = 'us-east-1'
|
region = 'us-east-1'
|
||||||
if service == 'dynamodb':
|
if service == 'dynamodb':
|
||||||
dynamo_api_version = environ['HTTP_X_AMZ_TARGET'].split("_")[1].split(".")[0]
|
if environ['HTTP_X_AMZ_TARGET'].startswith('DynamoDBStreams'):
|
||||||
# If Newer API version, use dynamodb2
|
host = 'dynamodbstreams'
|
||||||
if dynamo_api_version > "20111205":
|
else:
|
||||||
host = "dynamodb2"
|
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:
|
else:
|
||||||
host = "{service}.{region}.amazonaws.com".format(
|
host = "{service}.{region}.amazonaws.com".format(
|
||||||
service=service, region=region)
|
service=service, region=region)
|
||||||
|
@ -180,7 +180,7 @@ class TestEdges():
|
|||||||
assert 'LatestStreamLabel' in resp['TableDescription']
|
assert 'LatestStreamLabel' in resp['TableDescription']
|
||||||
|
|
||||||
# now try to enable it again
|
# now try to enable it again
|
||||||
with assert_raises(ValueError):
|
with assert_raises(conn.exceptions.ResourceInUseException):
|
||||||
resp = conn.update_table(
|
resp = conn.update_table(
|
||||||
TableName='test-streams',
|
TableName='test-streams',
|
||||||
StreamSpecification={
|
StreamSpecification={
|
||||||
|
Loading…
Reference in New Issue
Block a user