Audit breaks insertion of datetime fields
The stack trace speaks for itself:
ERROR:configdb.server.wsgiapp:exception in url=http://localhost:3000/create/host
Traceback (most recent call last):
File "build/bdist.macosx-10.8-x86_64/egg/configdb/server/wsgiapp.py", line 66, in _json_response_wrapper
'result': fn(*args, **kwargs)})
File "build/bdist.macosx-10.8-x86_64/egg/configdb/server/wsgiapp.py", line 125, in create
return g.api.create(class_name, g.request_data, g.auth_ctx)
File "build/bdist.macosx-10.8-x86_64/egg/configdb/db/db_api.py", line 15, in _with_session_wrapper
return fn(self, session, *args, **kwargs)
File "build/bdist.macosx-10.8-x86_64/egg/configdb/db/db_api.py", line 22, in _with_timestamp_wrapper
res = fn(self, session, entity_name, *args, **kwargs)
File "build/bdist.macosx-10.8-x86_64/egg/configdb/db/db_api.py", line 191, in create
data, auth_context, session)
File "build/bdist.macosx-10.8-x86_64/egg/configdb/db/interface/sa_interface.py", line 79, in add_audit
'data': json.dumps(data) if data else None,
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 201, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 264, in iterencode
return _iterencode(o, 0)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 178, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: datetime.datetime(2013, 5, 4, 19, 0, 43) is not JSON serializable