Ensure datetimes can be properly serialized.

The nova-network manager was returning db models from methods invoked
via rpc.call(). These db models include non-primitive types that can
not be properly serialized (namely datetime objects). Use
to_primitive() to ensure that the data gets serialized properly.

Fix bug: #1089430

Change-Id: I0519e88444b8fcc3af5e43170ea07dd966ccef05
Signed-off-by: zhiyanliu <lzy.dev@gmail.com>
Adds test for HTTPUnprocessableEntity when rebooting

Implements a test for 'HTTPUnprocessableEntity' error when rebooting
an instance.

Fixes Bug 1088672.

Change-Id: I7a658f4f09c871a43d20fd6fa60d4ad69784ce7d
Merge "Ensure datetimes can be properly serialized."
Merge "Adds test for HTTPUnprocessableEntity when rebooting"