From 9e1bd9d9313a9f324c5b7b02232e8bd2fd12ea8a Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 18 Jul 2012 16:47:34 -0400 Subject: Add missing convert_instances arg. When calling jsonutils.to_primitive() recursively, the convert_instances argument should be passed along. This change fixes one place where it was not. Change-Id: I536e1ca05bb4e613fba71298797879587e8b4b00 --- openstack/common/jsonutils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openstack') diff --git a/openstack/common/jsonutils.py b/openstack/common/jsonutils.py index e8e14c4..f96e727 100644 --- a/openstack/common/jsonutils.py +++ b/openstack/common/jsonutils.py @@ -109,7 +109,9 @@ def to_primitive(value, convert_instances=False, level=0): convert_instances=convert_instances, level=level + 1) elif hasattr(value, '__iter__'): - return to_primitive(list(value), level) + return to_primitive(list(value), + convert_instances=convert_instances, + level=level) elif convert_instances and hasattr(value, '__dict__'): # Likely an instance of something. Watch for cycles. # Ignore class member vars. -- cgit