Merge pull request #10747 from bcoca/fix_lsblk_missing
adjusted for the posibolity of lsblk not existing for fact gathering
This commit is contained in:
commit
2e9c028c6c
1 changed files with 7 additions and 6 deletions
|
@ -900,13 +900,14 @@ class LinuxHardware(Hardware):
|
|||
size_available = statvfs_result.f_bsize * (statvfs_result.f_bavail)
|
||||
except OSError, e:
|
||||
continue
|
||||
lsblkPath = module.get_bin_path("lsblk")
|
||||
rc, out, err = module.run_command("%s -ln --output UUID %s" % (lsblkPath, fields[0]), use_unsafe_shell=True)
|
||||
|
||||
if rc == 0:
|
||||
uuid = out.strip()
|
||||
else:
|
||||
uuid = 'NA'
|
||||
uuid = 'NA'
|
||||
lsblkPath = module.get_bin_path("lsblk")
|
||||
if lsblkPath:
|
||||
rc, out, err = module.run_command("%s -ln --output UUID %s" % (lsblkPath, fields[0]), use_unsafe_shell=True)
|
||||
|
||||
if rc == 0:
|
||||
uuid = out.strip()
|
||||
|
||||
self.facts['mounts'].append(
|
||||
{'mount': fields[1],
|
||||
|
|
Loading…
Reference in a new issue