mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #2054 from kavink/devel
Fixing logical error in detecting virtual device.
This commit is contained in:
commit
589548531e
1 changed files with 2 additions and 2 deletions
|
@ -387,7 +387,7 @@ class LinuxHardware(Hardware):
|
|||
return
|
||||
|
||||
for block in block_devs:
|
||||
virtual = 0
|
||||
virtual = 1
|
||||
sysfs_no_links = 0
|
||||
try:
|
||||
path = os.readlink(os.path.join("/sys/block/", block))
|
||||
|
@ -403,7 +403,7 @@ class LinuxHardware(Hardware):
|
|||
if sysfs_no_links == 1:
|
||||
for folder in os.listdir(sysdir):
|
||||
if re.search("device", folder):
|
||||
virtual = 1
|
||||
virtual = 0
|
||||
break
|
||||
if virtual:
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue