From d0fd8cefaa0c61ad0440347740fa4e56a15f5484 Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Fri, 21 Apr 2017 10:41:50 +0200 Subject: [PATCH] Fix the iosxr_facts mem gathering (#23850) We were not calling match.group, plus we were lacking a ':' from the expected output of 'show memory summary'. Fixes #23737 --- lib/ansible/modules/network/iosxr/iosxr_facts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/iosxr/iosxr_facts.py b/lib/ansible/modules/network/iosxr/iosxr_facts.py index f6aae5ccff0..7e6d625820f 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_facts.py +++ b/lib/ansible/modules/network/iosxr/iosxr_facts.py @@ -174,11 +174,11 @@ class Hardware(FactsBase): self.facts['filesystems'] = self.parse_filesystems( results['dir /all']) - match = re.search(r'Physical Memory (\d+)M total \((\d+)', + match = re.search(r'Physical Memory: (\d+)M total \((\d+)', results['show memory summary']) if match: - self.facts['memtotal_mb'] = int(match[0]) - self.facts['memfree_mb'] = int(match[1]) + self.facts['memtotal_mb'] = match.group(1) + self.facts['memfree_mb'] = match.group(2) def parse_filesystems(self, data): return re.findall(r'^Directory of (\S+)', data, re.M)