Network check fixes
- Proper network mapping
- Proper reclass lookup
- VIP detection
- Simple error gathering
- IP shown as 'exploded', i.e. in CIDR format
- MTU matching and detection
- Errors class for handling errors, including codes and indices
- Summary and detailed errors view
- Flake8 refactoring
Change-Id: I8ee37d345bdc21c7ad930bf8305acd28f8c121c8
Related-PROD: PROD-28199
diff --git a/cfg_checker/modules/reclass/__init__.py b/cfg_checker/modules/reclass/__init__.py
index 2546ec3..adae6df 100644
--- a/cfg_checker/modules/reclass/__init__.py
+++ b/cfg_checker/modules/reclass/__init__.py
@@ -1,21 +1,22 @@
import os
-import comparer
-import validator
-
from cfg_checker.common import logger_cli
from cfg_checker.helpers import args_utils
from cfg_checker.reports import reporter
+import comparer
+
+import validator
+
def do_list(args):
logger_cli.info("# Reclass list")
_arg_path = args_utils.get_arg(args, 'models_path')
logger_cli.info("-> Current path is: {}".format(_arg_path))
_path = args_utils.get_path_arg(_arg_path)
-
- logger_cli.info("# ...models path is '{}'".format(args.models_path))
-
+
+ logger_cli.info("# ...models path is '{}'".format(_path))
+
models = {}
for _folder in os.listdir(args.models_path):
# validate item as a model
@@ -24,15 +25,15 @@
_folder
)
_validated = validator.basic_model_validation_by_path(_model_path)
-
+
if not _validated:
logger_cli.info("-> '{}' not a valid model".format(_folder))
continue
else:
models[_folder] = _model_path
-
+
logger_cli.info("-> '{}' at '{}'".format(_folder, _model_path))
-
+
# TODO: collect info about the model
return
@@ -44,7 +45,7 @@
# checking folder params
_model1 = args_utils.get_path_arg(args.model1)
_model2 = args_utils.get_path_arg(args.model2)
-
+
# Do actual compare using hardcoded model names
mComparer = comparer.ModelComparer()
@@ -52,7 +53,7 @@
mComparer.model_path_1 = _model1
mComparer.model_name_2 = os.path.split(_model2)[1]
mComparer.model_path_2 = _model2
-
+
mComparer.load_model_tree(
mComparer.model_name_1,
mComparer.model_path_1