mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #4220 from dagwieers/setup-dmidecode-fix
Fix for commented dmidecode output
This commit is contained in:
commit
314e1aafc1
1 changed files with 2 additions and 1 deletions
|
@ -629,7 +629,8 @@ class LinuxHardware(Hardware):
|
||||||
if dmi_bin is not None:
|
if dmi_bin is not None:
|
||||||
(rc, out, err) = module.run_command('%s -s %s' % (dmi_bin, v))
|
(rc, out, err) = module.run_command('%s -s %s' % (dmi_bin, v))
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
self.facts[k] = out.rstrip()
|
# Strip out commented lines (specific dmidecode output)
|
||||||
|
self.facts[k] = ''.join([ line for line in out.split('\n') if not line.startswith('#') ])
|
||||||
else:
|
else:
|
||||||
self.facts[k] = 'NA'
|
self.facts[k] = 'NA'
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue