2015-11-16 14:27 GMT+01:00 <olichtne@redhat.com>:
From: Ondrej Lichtner <olichtne@redhat.com>

This extends the format_res_data method to support lists. This is very
usefull for test modules that return multiple entries of result data,
for example Netperf with multiple runs.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
---
 lnst/Common/NetTestCommand.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lnst/Common/NetTestCommand.py b/lnst/Common/NetTestCommand.py
index 7385e47..409076b 100644
--- a/lnst/Common/NetTestCommand.py
+++ b/lnst/Common/NetTestCommand.py
@@ -332,6 +332,13 @@ class NetTestCommandGeneric(object):
                 if type(value) == dict:
                     formatted_data += level*4*" " + str(key) + ":\n"
                     formatted_data += self.format_res_data(value, level+1)
+                if type(value) == list:
+                    formatted_data += level*4*" " + str(key) + ":\n"
+                    for i in range(0, len(value)):
+                        formatted_data += (level+1)*4*" " +\
+                                          "item %d:" % (i+1) + "\n"
+                        formatted_data += self.format_res_data(value[i],
+                                                               level+2)
                 else:
                     formatted_data += level*4*" " + str(key) + ":" + \
                                       (max_key_len-len(key))*" " + \
--
2.6.2
_______________________________________________
LNST-developers mailing list
lnst-developers@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/lnst-developers@lists.fedorahosted.org

ack to series

​Acked-By: Jiri Prochazka <jprochaz@redhat.com>​

--
​Best regards,​

Jiri Prochazka 
LNST Developer 
+420 532 294 633 | jprochaz@redhat.com
Red Hat Czech | Purkyňova 71/99, 612 00 Brno