From 360701ea433f08dd7395eae818ee9fee18ad4ba9 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. --- setup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup b/setup index bd0dfc4a989..ce0bb9a7521 100644 --- a/setup +++ b/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'):