Fix setup when /sys/block is inaccessible

parent 5ba090c3
...@@ -381,7 +381,12 @@ class LinuxHardware(Hardware): ...@@ -381,7 +381,12 @@ class LinuxHardware(Hardware):
if lspci: if lspci:
rc, pcidata, err = module.run_command(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 virtual = 0
sysfs_no_links = 0 sysfs_no_links = 0
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment