Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
3981c729
Commit
3981c729
authored
Nov 23, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Streamline code
parent
17020d6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
library/setup
+8
-18
No files found.
library/setup
View file @
3981c729
...
...
@@ -776,28 +776,18 @@ 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'
self
.
facts
[
'virtualization_role'
]
=
'guest'
return
else
:
continue
self
.
facts
[
'virtualization_role'
]
=
'guest'
return
# Beware that we can have both kvm and virtualbox running on a single system
if
os
.
path
.
exists
(
"/proc/modules"
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment