aboutsummaryrefslogtreecommitdiffstats
path: root/resources
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 09:00:43 +0000
commitc3e66ae43f10fb74b42bfd18fec59cdaa7f10cb7 (patch)
tree7d46b03f279bc2d57645d8dca1e9a079197b7784 /resources
parentbc37ed50da40a1cec8ff2bdafb8f08e3404cd793 (diff)
Fix: table_performance_improvements
Change-Id: I5052d47988c1644768ed6c8cdefc76dc1defb898 Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit d08498d06de775723a32597d109b537abf34a7e9)
Diffstat (limited to 'resources')
-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))