Streamline code
This commit is contained in:
parent
17020d6a75
commit
3981c72957
|
@ -776,26 +776,16 @@ class LinuxVirtual(Virtual):
|
|||
for line in open('/proc/cpuinfo').readlines():
|
||||
if re.match('^model name.*QEMU Virtual CPU', line):
|
||||
self.facts['virtualization_type'] = 'kvm'
|
||||
self.facts['virtualization_role'] = 'guest'
|
||||
return
|
||||
|
||||
if re.match('^vendor_id.*User Mode Linux', line):
|
||||
elif re.match('^vendor_id.*User Mode Linux', line):
|
||||
self.facts['virtualization_type'] = 'uml'
|
||||
self.facts['virtualization_role'] = 'guest'
|
||||
return
|
||||
|
||||
if re.match('^model name.*UML', line):
|
||||
elif re.match('^model name.*UML', line):
|
||||
self.facts['virtualization_type'] = 'uml'
|
||||
self.facts['virtualization_role'] = 'guest'
|
||||
return
|
||||
|
||||
if re.match('^vendor_id.*PowerVM Lx86', line):
|
||||
elif re.match('^vendor_id.*PowerVM Lx86', line):
|
||||
self.facts['virtualization_type'] = 'powervm_lx86'
|
||||
self.facts['virtualization_role'] = 'guest'
|
||||
return
|
||||
|
||||
if re.match('^vendor_id.*IBM/S390', line):
|
||||
elif re.match('^vendor_id.*IBM/S390', line):
|
||||
self.facts['virtualization_type'] = 'ibm_systemz'
|
||||
else:
|
||||
continue
|
||||
self.facts['virtualization_role'] = 'guest'
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in a new issue