Network report hotfix
Change-Id: I9434f42853b51e4f1d5ee01f09a16f0684b24732
Related-PROD: PROD-38972
diff --git a/cfg_checker/reports/reporter.py b/cfg_checker/reports/reporter.py
index 9cac4f5..5b5a37e 100644
--- a/cfg_checker/reports/reporter.py
+++ b/cfg_checker/reports/reporter.py
@@ -235,12 +235,10 @@
for node, dt in _dict.iteritems():
dt[_key] = {}
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] = {}
continue
lines = dt[_key_r].splitlines()
for line in lines:
@@ -267,12 +265,10 @@
for node, dt in _dict.iteritems():
dt[_key] = {}
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] = {}
continue
li = dt[_key_r].split()
dt[_key]['total'] = li[1]
@@ -301,12 +297,10 @@
for node, dt in _dict.iteritems():
dt[_key] = {}
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] = {}
continue
lines = dt[_key_r].splitlines()
for line in lines:
@@ -335,12 +329,10 @@
dt = _dict[node]
dt[_key] = {}
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] = {}
continue
lines = dt[_key_r].splitlines()
for line in lines:
@@ -372,7 +364,9 @@
_ts = [0, 0, 0, 0]
# skip if node is down
if dt['status'] == DOWN:
- dt.pop(_key_r)
+ dt[_key] = {
+ "total": [-1, -1, -1, -1]
+ }
continue
if not dt[_key_r]:
# no stats collected, put negatives
@@ -461,17 +455,18 @@
target_dict=data["nodes"]
)
for dt in data["nodes"].itervalues():
+ dt["disk"] = {}
+ dt["disk_max_dev"] = None
if dt['status'] == DOWN:
- dt.pop(_key_r)
+ dt["disk"]["unknown"] = {}
+ dt["disk_max_dev"] = "unknown"
continue
if not dt[_key_r]:
# no stats collected, put negatives
dt.pop(_key_r)
dt[_key] = {}
continue
- dt["disk"] = {}
# show first device row by default
- dt["disk_max_dev"] = None
_d = dt["disk"]
_r = dt["disk_raw"]
_r = _r.splitlines()