mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix setup when /sys/block is inaccessible
This commit is contained in:
parent
5ba090c366
commit
57cac788fb
1 changed files with 6 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue