Merge pull request #1 from 2mf/master
This commit is contained in:
commit
df8cd95841
@ -336,6 +336,8 @@ class DynamoDBBackend(BaseBackend):
|
|||||||
self.tables = OrderedDict()
|
self.tables = OrderedDict()
|
||||||
|
|
||||||
def create_table(self, name, **params):
|
def create_table(self, name, **params):
|
||||||
|
if name in self.tables:
|
||||||
|
return None
|
||||||
table = Table(name, **params)
|
table = Table(name, **params)
|
||||||
self.tables[name] = table
|
self.tables[name] = table
|
||||||
return table
|
return table
|
||||||
|
@ -100,12 +100,17 @@ class DynamoHandler(BaseResponse):
|
|||||||
attr = body["AttributeDefinitions"]
|
attr = body["AttributeDefinitions"]
|
||||||
# getting the indexes
|
# getting the indexes
|
||||||
global_indexes = body.get("GlobalSecondaryIndexes", [])
|
global_indexes = body.get("GlobalSecondaryIndexes", [])
|
||||||
|
|
||||||
table = dynamodb_backend2.create_table(table_name,
|
table = dynamodb_backend2.create_table(table_name,
|
||||||
schema=key_schema,
|
schema=key_schema,
|
||||||
throughput=throughput,
|
throughput=throughput,
|
||||||
attr=attr,
|
attr=attr,
|
||||||
global_indexes=global_indexes)
|
global_indexes=global_indexes)
|
||||||
return dynamo_json_dump(table.describe)
|
if table is not None:
|
||||||
|
return dynamo_json_dump(table.describe)
|
||||||
|
else:
|
||||||
|
er = 'com.amazonaws.dynamodb.v20111205#ResourceInUseException'
|
||||||
|
return self.error(er)
|
||||||
|
|
||||||
def delete_table(self):
|
def delete_table(self):
|
||||||
name = self.body['TableName']
|
name = self.body['TableName']
|
||||||
|
Loading…
Reference in New Issue
Block a user