[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[firstboot-rhel5] Print an error if we cannot import graphical firstboot (#706074)



If there's only firstboot-tui installed and DISPLAY is set,
do not traceback when importing firstbootWindow.
Print an error message stating what's wrong and exit.
---
 src/firstboot |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/firstboot b/src/firstboot
index ac3bf03..f2c49ac 100755
--- a/src/firstboot
+++ b/src/firstboot
@@ -97,8 +97,14 @@ if __name__ == "__main__":
     # Otherwise, run in text mode if in runlevel 3, or take over rhgb's X
     # server if running, or start up our own if not.
     if (not noX and os.environ.has_key("DISPLAY")) or fb.doDebug:
-        from firstbootWindow import firstbootWindow
-        firstbootWindow(fb)
+        try:
+            from firstbootWindow import firstbootWindow
+        except ImportError:
+            print "Cannot run firstboot-tui when DISPLAY is set.  You need to
+            install firstboot with gui support."
+            os._exit(0)
+        else:
+            firstbootWindow(fb)
     elif (getRunlevel() == 3 and not fb.forcegui) or noX == True:
         fb.runTextUI()
     elif rhgbIsRunning():
-- 
1.7.3.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]