1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

When checking for Xen for LinuxHardware processor facts, don't check sysfs if already found in /proc/

This commit is contained in:
Adam Miller 2015-01-08 11:29:11 -06:00
parent f274234824
commit 06b70e4f9c

View file

@ -612,10 +612,10 @@ class LinuxHardware(Hardware):
xen = False
xen_paravirt = False
try:
if os.path.exists('/proc/xen'):
xen = True
try:
if open('/sys/hypervisor/type').readline().strip() == 'xen':
elif open('/sys/hypervisor/type').readline().strip() == 'xen':
xen = True
except IOError:
pass