New package versions and Network ping hotfix
- added packages for 2.6 and 2.7
- method hotfix for --detailed option in mcp-net ping command
- some draft routines to get BIOS versions in net report
Change-Id: I927a95eb6a3041989e9d3099a1fa11b5edfd9757
Related-PROD: PROD-34257
diff --git a/cfg_checker/common/other.py b/cfg_checker/common/other.py
index 35495b3..a385b90 100644
--- a/cfg_checker/common/other.py
+++ b/cfg_checker/common/other.py
@@ -99,7 +99,10 @@
def get_node_code(self, fqdn):
# validate
_isvalid, _message = self.validate_name(fqdn, message=True)
- _code = re.findall(r"[a-zA-Z]+?(?=(?:[0-9]+$)|(?:\-+?)|(?:\_+?)|$)", fqdn.split('.')[0])
+ _code = re.findall(
+ r"[a-zA-Z]+?(?=(?:[0-9]+$)|(?:\-+?)|(?:\_+?)|$)",
+ fqdn.split('.')[0]
+ )
# check if it is valid and raise if not
if _isvalid:
# try to match it with ones in map
diff --git a/cfg_checker/modules/network/__init__.py b/cfg_checker/modules/network/__init__.py
index 6b9013a..71df82d 100644
--- a/cfg_checker/modules/network/__init__.py
+++ b/cfg_checker/modules/network/__init__.py
@@ -157,7 +157,7 @@
# if set, print details
if args.detailed:
- _pinger.print_error_details()
+ _pinger.print_details()
return
diff --git a/cfg_checker/reports/reporter.py b/cfg_checker/reports/reporter.py
index 5b5a37e..fa5fc72 100644
--- a/cfg_checker/reports/reporter.py
+++ b/cfg_checker/reports/reporter.py
@@ -224,6 +224,35 @@
else:
return int(value)
+ def _dmidecode(_dict, type=0):
+ _key = "dmi"
+ _key_r = "dmi_r"
+ _f_cmd = salt_master.get_cmd_for_nodes
+ _cmd = "dmidecode -t {}".format(type)
+ _f_cmd(_cmd, _key_r, target_dict=_dict)
+ # TODO: parse BIOS output or given type
+ pass
+
+ def _lsblk(_dict):
+ _key = "lsblk"
+ _key_r = "lsblk_raw"
+ _f_cmd = salt_master.get_cmd_for_nodes
+ _columns = [
+ "NAME",
+ "HCTL",
+ "TYPE",
+ "SIZE",
+ "VENDOR",
+ "MODEL",
+ "SERIAL",
+ "REV",
+ "TRAN"
+ ]
+ _cmd = "lsblk -S --output {}".format(",".join(_columns))
+ _f_cmd(_cmd, _key_r, target_dict=_dict)
+ # TODO: parse lsblk output
+ pass
+
def _lscpu(_dict):
_key = "lscpu"
_key_r = "lscpu_raw"