fix regex parse for total memory in slxos_facts.py (#43258)

* fix regex parse for total memory in slxos_facts.py

* account for one or no spaces per LindsayHill's suggestion
pull/43278/head
John Jensen 6 years ago committed by ansibot
parent 2a1a8585f3
commit 7ba0d8f60e

@ -208,7 +208,7 @@ class Hardware(FactsBase):
self.facts['memfree_mb'] = int(round(int(self.parse_memfree(data)) / 1024, 0)) self.facts['memfree_mb'] = int(round(int(self.parse_memfree(data)) / 1024, 0))
def parse_memtotal(self, data): def parse_memtotal(self, data):
match = re.search(r'TotalMemory: (\d+)\s', data, re.M) match = re.search(r'Total\s*Memory: (\d+)\s', data, re.M)
if match: if match:
return match.group(1) return match.group(1)

Loading…
Cancel
Save