FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Java

 
 
LinkBack Thread Tools
 
Old 08-25-2011, 07:58 AM
Martin Gracik
 
Default 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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-25-2011, 09:34 PM
"Brian C. Lane"
 
Default Print an error if we cannot import graphical firstboot (#706074)

On Thu, Aug 25, 2011 at 09:58:57AM +0200, Martin Gracik wrote:
> 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

Ack.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 05:55 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org