Skip nodes functionality for Package and Network modules
Added to main entrypoint
- Skip nodes using simple argument with '*' as a trailing wildcard
- Skip nodes using file list
Usability improovement
- Node list preview in status line
- Node stats alignment in net report
Minor fixes:
- Python version detection (3.5+)
- Node counter for each status
- Proper node skip handling
Change-Id: I086ef501bc06f0e739df25349257f1c63a2e2fcf
Related-PROD: PROD-35009
diff --git a/cfg_checker/reports/reporter.py b/cfg_checker/reports/reporter.py
index 3d3ede3..e0a746e 100644
--- a/cfg_checker/reports/reporter.py
+++ b/cfg_checker/reports/reporter.py
@@ -25,6 +25,7 @@
UP = const.NODE_UP
DOWN = const.NODE_DOWN
+SKIP = const.NODE_SKIP
def line_breaks(text):
@@ -265,7 +266,7 @@
# parse them and put into dict
for node, dt in _dict.items():
dt[_key] = {}
- if dt['status'] == DOWN:
+ if dt['status'] == DOWN or dt['status'] == SKIP:
continue
if not dt[_key_r]:
# no stats collected, put negatives
@@ -295,7 +296,7 @@
# parse them and put into dict
for node, dt in _dict.items():
dt[_key] = {}
- if dt['status'] == DOWN:
+ if dt['status'] == DOWN or dt['status'] == SKIP:
continue
if not dt[_key_r]:
# no stats collected, put negatives
@@ -327,7 +328,7 @@
_f_cmd(_cmd, _key_r, target_dict=_dict)
for node, dt in _dict.items():
dt[_key] = {}
- if dt['status'] == DOWN:
+ if dt['status'] == DOWN or dt['status'] == SKIP:
continue
if not dt[_key_r]:
# no stats collected, put negatives
@@ -359,7 +360,7 @@
for node in _kvm:
dt = _dict[node]
dt[_key] = {}
- if dt['status'] == DOWN:
+ if dt['status'] == DOWN or dt['status'] == SKIP:
continue
if not dt[_key_r]:
# no stats collected, put negatives
@@ -394,7 +395,7 @@
# totals for start mark
_ts = [0, 0, 0, 0]
# skip if node is down
- if dt['status'] == DOWN:
+ if dt['status'] == DOWN or dt['status'] == SKIP:
dt[_key] = {
"total": [-1, -1, -1, -1]
}
@@ -492,6 +493,10 @@
dt["disk"]["unknown"] = {}
dt["disk_max_dev"] = "unknown"
continue
+ if dt['status'] == SKIP:
+ dt["disk"]["skipped"] = {}
+ dt["disk_max_dev"] = "skipped"
+ continue
if not dt[_key_r]:
# no stats collected, put negatives
dt.pop(_key_r)