From b49cd77aace34df1dd5b1d3706c63631b7773a90 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Wed, 17 Aug 2016 13:43:52 -0400 Subject: [PATCH] Dump json for nova.network.model.Model objects The current repr for the network model objects is hard to debug, it would be easier if we just dumped a json blob to the logs which you can then take and throw into a formatter. Change-Id: If7f7999998d47a1c31137b549e7414afc9c07163 --- nova/network/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/network/model.py b/nova/network/model.py index be35712fe7..36cd85499c 100644 --- a/nova/network/model.py +++ b/nova/network/model.py @@ -136,7 +136,7 @@ NIC_NAME_LEN = 14 class Model(dict): """Defines some necessary structures for most of the network models.""" def __repr__(self): - return self.__class__.__name__ + '(' + dict.__repr__(self) + ')' + return jsonutils.dumps(self) def _set_meta(self, kwargs): # pull meta out of kwargs if it's there