Skip to content

Commit

Permalink
Ensure datetimes can be properly serialized.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zhiyanliu committed Dec 24, 2012
1 parent 1836ede commit e12a6f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nova/network/manager.py
Expand Up @@ -1912,7 +1912,7 @@ def get_instance_id_by_floating_address(self, context, address):
@wrap_check_policy
def get_network(self, context, network_uuid):
network = self.db.network_get_by_uuid(context.elevated(), network_uuid)
return dict(network.iteritems())
return jsonutils.to_primitive(network)

@wrap_check_policy
def get_all_networks(self, context):
Expand Down

0 comments on commit e12a6f6

Please sign in to comment.