parent
3680d65d1d
commit
97b6e99479
1 changed files with 3 additions and 3 deletions
|
@ -154,9 +154,9 @@ class LinuxVirtual(Virtual):
|
||||||
|
|
||||||
if os.path.exists('/proc/self/status'):
|
if os.path.exists('/proc/self/status'):
|
||||||
for line in get_file_lines('/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'
|
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'
|
virtual_facts['virtualization_role'] = 'host'
|
||||||
else:
|
else:
|
||||||
virtual_facts['virtualization_role'] = 'guest'
|
virtual_facts['virtualization_role'] = 'guest'
|
||||||
|
@ -212,7 +212,7 @@ class LinuxVirtual(Virtual):
|
||||||
if open(f).read().rstrip() == 'vdsm':
|
if open(f).read().rstrip() == 'vdsm':
|
||||||
virtual_facts['virtualization_type'] = 'RHEV'
|
virtual_facts['virtualization_type'] = 'RHEV'
|
||||||
break
|
break
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
virtual_facts['virtualization_type'] = 'kvm'
|
virtual_facts['virtualization_type'] = 'kvm'
|
||||||
|
|
Loading…
Reference in a new issue