Error occurred when creating a table

polikeiji avatarpolikeiji created an issue

I use ddbmock as regular client-server.

This is error message from the pserve process:

2013-07-03 19:39:36,686 DEBUG [Request logger][Dummy-2] request_id=73 action=CreateTable body={u'KeySchema': [{u'KeyType': u'HASH', u'AttributeName': u'screen_name'}, {u'KeyType': u'RANGE', u'AttributeName': u'access_token'}], 'request_id': '73', u'TableName': u'found2_access_tokens', u'AttributeDefinitions': [{u'AttributeName': u'screen_name', u'AttributeType': u'S'}, {u'AttributeName': u'access_token', u'AttributeType': u'S'}], u'ProvisionedThroughput': {u'WriteCapacityUnits': 1, u'ReadCapacityUnits': 1}}
2013-07-03 19:39:36,687 ERROR [Request logger][Dummy-2] request_id=73 action=CreateTable exception=AttributeError body=("'list' object has no attribute 'iteritems'",)
2013-07-03 19:39:36,687 ERROR [waitress][Dummy-2] Exception when serving /
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/waitress/channel.py", line 332, in service
    task.service()
  File "/Library/Python/2.7/site-packages/waitress/task.py", line 174, in service
    self.execute()
  File "/Library/Python/2.7/site-packages/waitress/task.py", line 382, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/Library/Python/2.7/site-packages/pyramid/router.py", line 251, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/Library/Python/2.7/site-packages/pyramid/router.py", line 227, in invoke_subrequest
    response = handle_request(request)
  File "/Library/Python/2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/Library/Python/2.7/site-packages/pyramid/router.py", line 161, in handle_request
    response = view_callable(context, request)
  File "/Library/Python/2.7/site-packages/pyramid/config/views.py", line 377, in viewresult_to_response
    result = view(context, request)
  File "/Library/Python/2.7/site-packages/pyramid/config/views.py", line 493, in _requestonly_view
    response = view(request)
  File "/Library/Python/2.7/site-packages/ddbmock/router/pyramid.py", line 21, in pyramid_router
    body = router(action, post)
  File "/Library/Python/2.7/site-packages/ddbmock/router/__init__.py", line 35, in router
    post = dynamodb_api_validate(target, post)
  File "/Library/Python/2.7/site-packages/ddbmock/validators/__init__.py", line 27, in dynamodb_api_validate
    return validate(post)
  File "/Library/Python/2.7/site-packages/onctuous/schema.py", line 49, in __call__
    return self.validate([], self.schema, data)
  File "/Library/Python/2.7/site-packages/onctuous/schema.py", line 62, in validate
    return self._validate_dict(path, schema, data)
  File "/Library/Python/2.7/site-packages/onctuous/schema.py", line 125, in _validate_dict
    out[new_key] = self.validate(key_path, rule, value)
  File "/Library/Python/2.7/site-packages/onctuous/schema.py", line 62, in validate
    return self._validate_dict(path, schema, data)
  File "/Library/Python/2.7/site-packages/onctuous/schema.py", line 100, in _validate_dict
    for key, value in data.iteritems():
AttributeError: 'list' object has no attribute 'iteritems'

Sincerely

Comments (1)

  1. polikeiji

    I think the rule of ddbmock.validators.types.table_key_schema does not match for KeyChema request parameter of DynamoDB's CreateTable API.

    The rule expects a dict parameter, but actually the parameter is a list.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.