From 75071f16c19d8dde0233f6d4ec762db12c108170 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 16 May 2024 12:11:38 -0700 Subject: [PATCH] CI fixes Signed-off-by: Abhijeet Kasurde --- lib/ansible/module_utils/facts/hardware/freebsd.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/ansible/module_utils/facts/hardware/freebsd.py b/lib/ansible/module_utils/facts/hardware/freebsd.py index fabb45348d2..9628fa01720 100644 --- a/lib/ansible/module_utils/facts/hardware/freebsd.py +++ b/lib/ansible/module_utils/facts/hardware/freebsd.py @@ -63,10 +63,7 @@ class FreeBSDHardware(Hardware): dmesg_boot = get_file_content(FreeBSDHardware.DMESG_BOOT) if not dmesg_boot: - dmesg_cmd = self.module.get_bin_path( - "dmesg", - warning="falling back to sysctl for processor_count, default to [] for processor" - ) + dmesg_cmd = self.module.get_bin_path("dmesg") if dmesg_cmd is None: return cpu_facts try: @@ -99,7 +96,7 @@ class FreeBSDHardware(Hardware): if freecount is not None: memory_facts['memfree_mb'] = pagesize * freecount // 1024 // 1024 - swapinfo_cmd = self.module.get_bin_path('swapinfo', warning="skipping swap facts") + swapinfo_cmd = self.module.get_bin_path('swapinfo') if swapinfo_cmd is None: return memory_facts @@ -121,13 +118,13 @@ class FreeBSDHardware(Hardware): def get_uptime_facts(self): # On FreeBSD, the default format is annoying to parse. # Use -b to get the raw value and decode it. - sysctl_cmd = self.module.get_bin_path('sysctl', warning="skipping uptime fact") + sysctl_cmd = self.module.get_bin_path('sysctl') if not sysctl_cmd: return {} cmd = [sysctl_cmd, '-b', 'kern.boottime'] # We need to get raw bytes, not UTF-8. - rc, out, _ = self.module.run_command(cmd, encoding=None) + rc, out, dummy = self.module.run_command(cmd, encoding=None) # kern.boottime returns seconds and microseconds as two 64-bits # fields, but we are only interested in the first field. @@ -229,7 +226,7 @@ class FreeBSDHardware(Hardware): dmi_facts = {} # Fall back to using dmidecode, if available - dmi_bin = self.module.get_bin_path('dmidecode', warning="skipping dmi facts") + dmi_bin = self.module.get_bin_path('dmidecode') if not dmi_bin: return dmi_facts DMI_DICT = {