Fixes for Network check report
- default values if nodee check failed
- net interface mapping fix
- net tree creation fix for multi-branched bonds
Change-Id: Ic1a4709d258201c7ed4a7a70aaef98bb9aa53f7b
Related-PROD: PROD-32792
diff --git a/cfg_checker/reports/reporter.py b/cfg_checker/reports/reporter.py
index aa399df..40f2c59 100644
--- a/cfg_checker/reports/reporter.py
+++ b/cfg_checker/reports/reporter.py
@@ -343,15 +343,23 @@
for node, dt in _dict.iteritems():
_cpuindex = 1
_add_mode = True
- # final totals
- dt[_key] = {
- "total": [0, 0, 0, 0]
- }
# totals for start mark
_ts = [0, 0, 0, 0]
# skip if node is down
if dt['status'] == DOWN:
+ dt.pop(_key_r)
continue
+ if not dt[_key_r]:
+ # no stats collected, put negatives
+ dt.pop(_key_r)
+ dt[_key] = {
+ "total": [-1, -1, -1, -1]
+ }
+ continue
+ # final totals
+ dt[_key] = {
+ "total": [0, 0, 0, 0]
+ }
lines = dt[_key_r].splitlines()
for line in lines:
if line.startswith("#"):