Browse code

adjusted for the posibolity of lsblk not existing for fact gathering

Brian Coca authored on 2015/04/17 00:54:50
Showing 1 changed files
... ...
@@ -883,13 +883,14 @@ class LinuxHardware(Hardware):
883 883
                         size_available = statvfs_result.f_bsize * (statvfs_result.f_bavail)
884 884
                     except OSError, e:
885 885
                         continue
886
+
887
+                    uuid = 'NA'
886 888
                     lsblkPath = module.get_bin_path("lsblk")
887
-                    rc, out, err = module.run_command("%s -ln --output UUID %s" % (lsblkPath, fields[0]), use_unsafe_shell=True)
889
+                    if lsblkPath:
890
+                        rc, out, err = module.run_command("%s -ln --output UUID %s" % (lsblkPath, fields[0]), use_unsafe_shell=True)
888 891
 
889
-                    if rc == 0:
890
-                        uuid = out.strip()
891
-                    else:
892
-                        uuid = 'NA'
892
+                        if rc == 0:
893
+                            uuid = out.strip()
893 894
 
894 895
                     self.facts['mounts'].append(
895 896
                         {'mount': fields[1],