summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2010-03-05 10:38:06 +0100
committerAles Kozumplik <akozumpl@redhat.com>2010-03-05 10:38:06 +0100
commit95e9f51b94849a316e5721cd9cdddf8a26d51604 (patch)
tree35e2148cf0e14316d738cc9a81b79f123d4f40e9
parent83cdc230487df846843e11cc01c03102e07966c5 (diff)
downloadanaconda-95e9f51b94849a316e5721cd9cdddf8a26d51604.tar.gz
anaconda-95e9f51b94849a316e5721cd9cdddf8a26d51604.tar.xz
anaconda-95e9f51b94849a316e5721cd9cdddf8a26d51604.zip
fix: do not initialize the install interface whenever is is accessed (#565872)
This problem has been present after 39a52ed1ddb2c. VNC+kickstart with %pre script installs were crashing due to attempt to use X server to early.
-rwxr-xr-xanaconda65
1 files changed, 35 insertions, 30 deletions
diff --git a/anaconda b/anaconda
index 5a42f0cac..e6cdb94df 100755
--- a/anaconda
+++ b/anaconda
@@ -514,36 +514,6 @@ class Anaconda(object):
return self._instLanguage
def _getInterface(self):
- if self._intf:
- return self._intf
-
- # setup links required by graphical mode if installing and verify display mode
- if self.displayMode == 'g':
- stdoutLog.info (_("Starting graphical installation."))
-
- try:
- from gui import InstallInterface
- except Exception, e:
- stdoutLog.error("Exception starting GUI installer: %s" %(e,))
- # if we're not going to really go into GUI mode, we need to get
- # back to vc1 where the text install is going to pop up.
- if not flags.livecdInstall:
- isys.vtActivate (1)
- stdoutLog.warning("GUI installer startup failed, falling back to text mode.")
- self.displayMode = 't'
- if 'DISPLAY' in os.environ.keys():
- del os.environ['DISPLAY']
- time.sleep(2)
-
- if self.displayMode == 't':
- from text import InstallInterface
- if not os.environ.has_key("LANG"):
- os.environ["LANG"] = "en_US.UTF-8"
-
- if self.displayMode == 'c':
- from cmdline import InstallInterface
-
- self._intf = InstallInterface()
return self._intf
def _setInterface(self, v):
@@ -610,6 +580,39 @@ class Anaconda(object):
exn.write(self, fo)
+ def initInterface(self):
+ if self._intf:
+ raise RuntimeError, "Second attempt to initialize the InstallInterface"
+
+ # setup links required by graphical mode if installing and verify display mode
+ if self.displayMode == 'g':
+ stdoutLog.info (_("Starting graphical installation."))
+
+ try:
+ from gui import InstallInterface
+ except Exception, e:
+ stdoutLog.error("Exception starting GUI installer: %s" %(e,))
+ # if we're not going to really go into GUI mode, we need to get
+ # back to vc1 where the text install is going to pop up.
+ if not flags.livecdInstall:
+ isys.vtActivate (1)
+ stdoutLog.warning("GUI installer startup failed, falling back to text mode.")
+ self.displayMode = 't'
+ if 'DISPLAY' in os.environ.keys():
+ del os.environ['DISPLAY']
+ time.sleep(2)
+
+ if self.displayMode == 't':
+ from text import InstallInterface
+ if not os.environ.has_key("LANG"):
+ os.environ["LANG"] = "en_US.UTF-8"
+
+ if self.displayMode == 'c':
+ from cmdline import InstallInterface
+
+ self._intf = InstallInterface()
+ return self._intf
+
def writeXdriver(self):
# this should go away at some point, but until it does, we
# need to keep it around.
@@ -1095,6 +1098,8 @@ if __name__ == "__main__":
runVNC()
doStartupX11Actions(opts.runres)
+ # with X running we can initialize the UI interface
+ anaconda.initInterface()
anaconda.instClass.configure(anaconda)
# comment out the next line to make exceptions non-fatal