Commit 7cd013f8 by Michael DeHaan

Merge pull request #1542 from arrfab/xen-fact-issue

Fixed the way dom0/domU xen role is defined in the setup module
parents 1b8d912d 29882f97
...@@ -711,11 +711,12 @@ class LinuxVirtual(Virtual): ...@@ -711,11 +711,12 @@ class LinuxVirtual(Virtual):
def get_virtual_facts(self): def get_virtual_facts(self):
if os.path.exists("/proc/xen"): if os.path.exists("/proc/xen"):
self.facts['virtualization_type'] = 'xen' self.facts['virtualization_type'] = 'xen'
self.facts['virtualization_role'] = 'guest'
if os.path.exists('/proc/xen/capabilities'): if os.path.exists('/proc/xen/capabilities'):
self.facts['virtualization_role'] = 'host' for line in open('/proc/xen/capabilities'):
else: if "control_d" in line:
self.facts['virtualization_role'] = 'guest' self.facts['virtualization_role'] = 'host'
elif os.path.exists('/proc/vz'): elif os.path.exists('/proc/vz'):
self.facts['virtualization_type'] = 'openvz' self.facts['virtualization_type'] = 'openvz'
if os.path.exists('/proc/vz/version'): if os.path.exists('/proc/vz/version'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment