From 97b6e99479178addf21c380c1b653f734ddb0cea Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 12 Feb 2018 10:21:10 -0500 Subject: [PATCH] fixes to virtual facts fixes #36038 --- lib/ansible/module_utils/facts/virtual/linux.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/facts/virtual/linux.py b/lib/ansible/module_utils/facts/virtual/linux.py index a2b41b30b6..a0ad54584b 100644 --- a/lib/ansible/module_utils/facts/virtual/linux.py +++ b/lib/ansible/module_utils/facts/virtual/linux.py @@ -154,9 +154,9 @@ class LinuxVirtual(Virtual): if os.path.exists('/proc/self/status'): for line in get_file_lines('/proc/self/status'): - if re.match(r'^VxID: \d+', line): + if re.match(r'^VxID:\s+\d+', line): virtual_facts['virtualization_type'] = 'linux_vserver' - if re.match(r'^VxID: 0', line): + if re.match(r'^VxID:\s+0', line): virtual_facts['virtualization_role'] = 'host' else: virtual_facts['virtualization_role'] = 'guest' @@ -212,7 +212,7 @@ class LinuxVirtual(Virtual): if open(f).read().rstrip() == 'vdsm': virtual_facts['virtualization_type'] = 'RHEV' break - except: + except Exception: pass else: virtual_facts['virtualization_type'] = 'kvm'