aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_tables.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2017-10-27 10:56:01 +0200
committerTibor Frank <tifrank@cisco.com>2017-10-27 10:59:18 +0200
commitd08498d06de775723a32597d109b537abf34a7e9 (patch)
tree66211a0f7608c33f0c213db80e3d04948aade5fd /resources/tools/presentation/generator_tables.py
parent90cd968d53e450c4da3aeece28f19963e333794a (diff)
Fix: table_performance_improvements
Change-Id: I5052d47988c1644768ed6c8cdefc76dc1defb898 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_tables.py')
-rw-r--r--resources/tools/presentation/generator_tables.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py
index 0ff4de6c08..195380f7fb 100644
--- a/resources/tools/presentation/generator_tables.py
+++ b/resources/tools/presentation/generator_tables.py
@@ -189,12 +189,17 @@ def table_performance_improvements(table, input_data):
tbl_item.append({"data": eval(operation)(data_lst)})
elif cmd == "operation":
operation = args[0]
- nr1 = tbl_item[int(args[1])]["data"]
- nr2 = tbl_item[int(args[2])]["data"]
- if nr1 and nr2:
- tbl_item.append({"data": eval(operation)(nr1, nr2)})
- else:
+ try:
+ nr1 = tbl_item[int(args[1])]["data"]
+ nr2 = tbl_item[int(args[2])]["data"]
+ if nr1 and nr2:
+ tbl_item.append({"data": eval(operation)(nr1, nr2)})
+ else:
+ tbl_item.append({"data": None})
+ except IndexError:
+ logging.error("No data for {0}".format(tbl_item[0]))
tbl_item.append({"data": None})
+ continue
else:
logging.error("Not supported command {0}. Skipping the table.".
format(cmd))