diff --git a/library/setup b/library/setup index 82e21da845..1d0c05d552 100644 --- a/library/setup +++ b/library/setup @@ -381,7 +381,12 @@ class LinuxHardware(Hardware): if lspci: rc, pcidata, err = module.run_command(lspci) - for block in os.listdir("/sys/block"): + try: + block_devs = os.listdir("/sys/block") + except OSError: + return + + for block in block_devs: virtual = 0 sysfs_no_links = 0 try: