summaryrefslogtreecommitdiffstats
path: root/openstack/common
diff options
context:
space:
mode:
Diffstat (limited to 'openstack/common')
-rw-r--r--openstack/common/jsonutils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/openstack/common/jsonutils.py b/openstack/common/jsonutils.py
index 6130a7f..f96e727 100644
--- a/openstack/common/jsonutils.py
+++ b/openstack/common/jsonutils.py
@@ -107,9 +107,11 @@ def to_primitive(value, convert_instances=False, level=0):
elif hasattr(value, 'iteritems'):
return to_primitive(dict(value.iteritems()),
convert_instances=convert_instances,
- level=level)
+ 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.