From f2541b3b4e176a7d0d9cca05e8e5dc9e5ff27ddb Mon Sep 17 00:00:00 2001 From: bk2zsto Date: Wed, 7 Sep 2022 19:31:57 -0400 Subject: Equuleus facts (#271) * support 1.3 version output Co-authored-by: Kate Case --- changelogs/fragments/271_equuleus_facts.yaml | 3 +++ plugins/cliconf/vyos.py | 2 +- plugins/module_utils/network/vyos/facts/legacy/base.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/271_equuleus_facts.yaml diff --git a/changelogs/fragments/271_equuleus_facts.yaml b/changelogs/fragments/271_equuleus_facts.yaml new file mode 100644 index 0000000..1399180 --- /dev/null +++ b/changelogs/fragments/271_equuleus_facts.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - Update fact gathering to support v1.3 show version output diff --git a/plugins/cliconf/vyos.py b/plugins/cliconf/vyos.py index f2064d7..885cf1f 100644 --- a/plugins/cliconf/vyos.py +++ b/plugins/cliconf/vyos.py @@ -83,7 +83,7 @@ class Cliconf(CliconfBase): if match: device_info["network_os_version"] = match.group(1) - match = re.search(r"HW model:\s*(\S+)", data) + match = re.search(r"(?:HW|Hardware) model:\s*(\S+)", data) if match: device_info["network_os_model"] = match.group(1) diff --git a/plugins/module_utils/network/vyos/facts/legacy/base.py b/plugins/module_utils/network/vyos/facts/legacy/base.py index a493421..6f063d6 100644 --- a/plugins/module_utils/network/vyos/facts/legacy/base.py +++ b/plugins/module_utils/network/vyos/facts/legacy/base.py @@ -47,7 +47,7 @@ class Default(LegacyFactsBase): self.facts.update(self.platform_facts()) def parse_serialnum(self, data): - match = re.search(r"HW S/N:\s+(\S+)", data) + match = re.search(r"(?:HW|Hardware) S/N:\s+(\S+)", data) if match: return match.group(1) -- cgit v1.2.3