From 06b70e4f9c3d82f5dca1a242da9bebe947bfe4de Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 8 Jan 2015 11:29:11 -0600 Subject: [PATCH] When checking for Xen for LinuxHardware processor facts, don't check sysfs if already found in /proc/ --- lib/ansible/module_utils/facts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index d9929c83386..36f706d02ce 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -612,10 +612,10 @@ class LinuxHardware(Hardware): xen = False xen_paravirt = False - if os.path.exists('/proc/xen'): - xen = True try: - if open('/sys/hypervisor/type').readline().strip() == 'xen': + if os.path.exists('/proc/xen'): + xen = True + elif open('/sys/hypervisor/type').readline().strip() == 'xen': xen = True except IOError: pass