From 3bc6228b9748ec10838c7f1ed61f553f575dcf9c Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Thu, 10 Jan 2013 18:22:01 +0100 Subject: [PATCH] Handle unreadable /proc/xen/capabilities Fixes #1854. --- library/setup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/setup b/library/setup index bd0dfc4a989..ce0bb9a7521 100644 --- a/library/setup +++ b/library/setup @@ -713,10 +713,12 @@ class LinuxVirtual(Virtual): if os.path.exists("/proc/xen"): self.facts['virtualization_type'] = 'xen' self.facts['virtualization_role'] = 'guest' - if os.path.exists('/proc/xen/capabilities'): + try: for line in open('/proc/xen/capabilities'): if "control_d" in line: self.facts['virtualization_role'] = 'host' + except IOError: + pass return if os.path.exists('/proc/vz'):