summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/models.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/models.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/models.py b/utils/test/testapi/opnfv_testapi/resources/models.py
index c85c1d5b1..a281c66d8 100644
--- a/utils/test/testapi/opnfv_testapi/resources/models.py
+++ b/utils/test/testapi/opnfv_testapi/resources/models.py
@@ -24,7 +24,6 @@ class ModelBase(object):
def _format(self, excludes):
new_obj = copy.deepcopy(self)
dicts = new_obj.__dict__
- print self, self.__class__
for k in dicts.keys():
if k in excludes:
del dicts[k]
@@ -32,9 +31,9 @@ class ModelBase(object):
if hasattr(dicts[k], 'format'):
dicts[k] = dicts[k].format()
elif isinstance(dicts[k], list):
- hs = []
- for h in dicts[k]:
- hs.append(h.format())
+ hs = list()
+ [hs.append(h.format() if hasattr(h, 'format') else str(h))
+ for h in dicts[k]]
dicts[k] = hs
elif not isinstance(dicts[k], (str, int, float, dict)):
dicts[k] = str(dicts[k])