mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00: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:
@@ -208,7 +208,7 @@ class Hardware(FactsBase):
|
||||
self.facts['memfree_mb'] = int(round(int(self.parse_memfree(data)) / 1024, 0))
|
||||
|
||||
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:
|
||||
return match.group(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user