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/packages/checker.py b/cfg_checker/modules/packages/checker.py
index 8a3456d..3225f70 100644
--- a/cfg_checker/modules/packages/checker.py
+++ b/cfg_checker/modules/packages/checker.py
@@ -1,18 +1,12 @@
import json
-import os
-#import sys
-from copy import deepcopy
-
+from cfg_checker.common import const, logger_cli
from cfg_checker.common.exception import ConfigException
-from cfg_checker.common import utils, const
-from cfg_checker.common import config, logger, logger_cli, pkg_dir
-from cfg_checker.common import salt_utils
from cfg_checker.helpers.console_utils import Progress
-from cfg_checker.nodes import SaltNodes, node_tmpl
+from cfg_checker.nodes import SaltNodes
from cfg_checker.reports import reporter
-from versions import PkgVersions, DebianVersion, VersionCmpResult
+from versions import DebianVersion, PkgVersions, VersionCmpResult
class CloudPackageChecker(SaltNodes):
@@ -99,7 +93,6 @@
_eo += _val['results'].keys().count(const.VERSION_ERR)
_do += _val['results'].keys().count(const.VERSION_DOWN)
-
_progress.newline()
_data['errors'] = {
@@ -133,13 +126,15 @@
_text = _result[key]
try:
_dict = json.loads(_text[_text.find('{'):])
- except ValueError as e:
+ except ValueError:
logger_cli.info("... no JSON for '{}'".format(
key
))
- logger_cli.debug("ERROR:\n{}\n".format(_text[:_text.find('{')]))
+ logger_cli.debug(
+ "ERROR:\n{}\n".format(_text[:_text.find('{')])
+ )
_dict = {}
-
+
self.nodes[key]['packages'] = _dict
else:
self.nodes[key]['packages'] = {}
@@ -157,8 +152,10 @@
"""
# Preload OpenStack release versions
_desc = PkgVersions()
-
- logger_cli.info("# Cross-comparing: Installed vs Candidates vs Release")
+
+ logger_cli.info(
+ "# Cross-comparing: Installed vs Candidates vs Release"
+ )
_progress = Progress(len(self.nodes.keys()))
_progress_index = 0
_total_processed = 0
@@ -196,10 +193,10 @@
# no description - no library :)
_vers = {}
_pkg_desc = _desc.dummy_desc
-
+
# get specific set for this OS release if present
if _os in _vers:
- _v = _vers[_os]
+ _v = _vers[_os]
elif 'any' in _vers:
_v = _vers['any']
else:
@@ -212,13 +209,13 @@
"results": {},
"r": _release,
}
-
+
_cmp = VersionCmpResult(
_ver_ins,
_ver_can,
_all_packages[_name]['r']
)
-
+
# shortcut to results
_res = _all_packages[_name]['results']
# update status
@@ -240,7 +237,6 @@
self._packages = _all_packages
_progress.newline()
-
def create_report(self, filename, rtype, full=None):
"""