1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
This commit is contained in:
John Jensen 2018-07-25 16:59:23 -04:00 committed by ansibot
parent 2a1a8585f3
commit 7ba0d8f60e

View file

@ -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)