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:
parent
2a1a8585f3
commit
7ba0d8f60e
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue