Commits

schugschug committed 4e87455

use request.json_body

Comments (0)

Files changed (2)

ddbmock/router/__init__.py

         mod = import_module('ddbmock.operations.{}'.format(target))
         func = getattr(mod, target)
     except ImportError:
-        req_logger.error('request_id=%s action=%s No such action', request_id, action)
+        req_logger.error('A request_id=%s action=%s No such action', request_id, action)
         raise InternalFailure("Method: {} does not exist".format(action))
 
     # Validate the input
     try:
         post = dynamodb_api_validate(target, post)
     except Exception as e:
-        req_logger.error('request_id=%s action=%s exception=%s body=%s', request_id, action, type(e).__name__, str(e.args))
+        req_logger.error('B request_id=%s action=%s exception=%s body=%s', request_id, action, type(e).__name__, str(e.args))
         raise
 
     # Run request and translate engine errors to DynamoDB errors
         #req_logger.debug("request_id=%s action=%s answer=%s", post['request_id'], action, answer)
         return answer
     except (TypeError, ValueError, KeyError) as e:
-        req_logger.error('request_id=%s action=%s exception=%s body=%s', request_id, action, type(e).__name__, str(e.args))
+        req_logger.error('C request_id=%s action=%s exception=%s body=%s post=%s', request_id, action, type(e).__name__, str(e.args),post)
         raise InternalFailure("{}: {}".format(type(e).__name__, str(e.args)))

ddbmock/router/pyramid.py

     target = request.headers.get('x-amz-target')
     action = target.split('.', 2)[1] if target is not None else ""
 
-    post = request.json
+    post = request.json_body
 
     # do the job
     try:
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.