summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2008-04-23 17:47:00 +0200
committerJoel Andres Granados <jgranado@redhat.com>2008-04-23 17:47:07 +0200
commit77e4dab8f06cfed775c73624a33f91b34f8595d6 (patch)
treef94976fe9d44720e025fc774e0df4f444541767e /iutil.py
parent8b01b7eef835e629f449a443ef50baf9044519ac (diff)
downloadanaconda-77e4dab8f06cfed775c73624a33f91b34f8595d6.tar.gz
anaconda-77e4dab8f06cfed775c73624a33f91b34f8595d6.tar.xz
anaconda-77e4dab8f06cfed775c73624a33f91b34f8595d6.zip
Avoid putting virtualization option when in Xen or VMware. (#443373)
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/iutil.py b/iutil.py
index 2483e0c56..9ce05b89f 100644
--- a/iutil.py
+++ b/iutil.py
@@ -527,3 +527,20 @@ def writeRpmPlatform(root="/"):
f.write("%_prefer_color 1\n")
f.close()
+
+## Check to see if we are in a xen environment.
+#
+def inXen():
+ if os.path.exists("/proc/xen"):
+ return True
+ return False
+
+## Check to see if we are in a vmware environment.
+#
+def inVmware():
+ lspci = ["/usr/sbin/lspci", "-vvv"] # only the very verbose show the VMware stuff :)
+ proc = subprocess.Popen(lspci, stdout = subprocess.PIPE)
+ (out, err) = proc.communicate()
+ if "VMware" in out:
+ return True
+ return False