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 > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 12-15-2009, 07:17 PM
Mark Hamzy
 
Default display reIPL information via lsreipl

At the end of an installation, display on the terminal where the

390 will reboot into. Note that this uses different code than

anaconda uses to provide more reliability.



---

anaconda | 2 ++

gui.py | 1 +

iutil.py | 9 +++++++++

3 files changed, 12 insertions(+), 0 deletions(-)



diff --git a/anaconda b/anaconda

index 746ce1f..f6a3059 100755

--- a/anaconda

+++ b/anaconda

@@ -977,4 +977,6 @@ if __name__ == "__main__":

log.info("attempting to eject %s" % drive.path)

drive.eject()



+ iutil.dumpReIPLFiles ()

+

del anaconda.intf

diff --git a/gui.py b/gui.py

index 4e65362..bfeb65c 100755

--- a/gui.py

+++ b/gui.py

@@ -1330,6 +1330,7 @@ class InstallControlWindow:

takeScreenShot()



def _doExit (self, *args):

+ iutil.dumpReIPLFiles ()

gtk.main_quit()

os._exit(0)



diff --git a/iutil.py b/iutil.py

index f83b002..ecdc196 100644

--- a/iutil.py

+++ b/iutil.py

@@ -1015,6 +1015,15 @@ def reIPL(anaconda, loader_pid):

# or a two-item list with errorMessage and rebootInstr (=> shutdown)

return message



+def dumpReIPLFiles ():

+ if not isS390():

+ return

+

+ try:

+ execWithRedirect ("lsreipl", [], stdout = "/dev/tty3", stderr = "/dev/tty3", searchPath=1)

+ except Exception, e:

+ log.info("dumpReIPLFiles: Caught exception %s", (e,))

+

def resetRpmDb(rootdir):

for rpmfile in glob.glob("%s/var/lib/rpm/__db.*" % rootdir):

try:

--

1.6.4.4



--

Mark



You must be the change you wish to see in the world. -- Mahatma Gandhi

Worrying is praying for that you do not wish to happen.___________________________________________ ____
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-16-2009, 03:05 PM
Chris Lumens
 
Default display reIPL information via lsreipl

> At the end of an installation, display on the terminal where the
> 390 will reboot into. Note that this uses different code than
> anaconda uses to provide more reliability.

I definitely prefer this to dumping out all the information manually,
both here and in loader.

> diff --git a/iutil.py b/iutil.py
> index f83b002..ecdc196 100644
> --- a/iutil.py
> +++ b/iutil.py
> @@ -1015,6 +1015,15 @@ def reIPL(anaconda, loader_pid):
> # or a two-item list with errorMessage and rebootInstr (=> shutdown)
> return message
>
> +def dumpReIPLFiles ():
> + if not isS390():
> + return
> +
> + try:
> + execWithRedirect ("lsreipl", [], stdout = "/dev/tty3", stderr = "/dev/tty3", searchPath=1)
> + except Exception, e:
> + log.info("dumpReIPLFiles: Caught exception %s", (e,))
> +
> def resetRpmDb(rootdir):
> for rpmfile in glob.glob("%s/var/lib/rpm/__db.*" % rootdir):
> try:

Please don't catch the top-level Exception. If you are expecting a
specific exception, catch that. Otherwise, what are you expecting to
happen here?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-16-2009, 04:10 PM
Mark Hamzy
 
Default display reIPL information via lsreipl

clumens@redhat.com wrote on 12/16/2009 10:12:13 AM:



> Please don't catch the top-level Exception. *If you are expecting a

> specific exception, catch that. *Otherwise, what are you expecting to

> happen here?



During development of this, an Exception was thrown by execWithRedirect.

This caused installation to fail. *Which is why I added the catch.

I don't remember the exact exception. *However, as this is only informational,

I really don't want an exception to abort the installation.



Obviously, the executable can be corrupted, or not have correct permissions,

or have a run time problem. *I didn't know the complete list of possible

exceptions, so I caught the parent.



I can remove the exception if you want...



--

Mark



You must be the change you wish to see in the world. -- Mahatma Gandhi

Worrying is praying for that you do not wish to happen.



_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-17-2009, 01:19 PM
Chris Lumens
 
Default display reIPL information via lsreipl

> During development of this, an Exception was thrown by execWithRedirect.
> This caused installation to fail. Which is why I added the catch.
> I don't remember the exact exception. However, as this is only
> informational,
> I really don't want an exception to abort the installation.

Can you check again and see what the exception was?

The problem here is that while it may be informational, if it stops
working, it's going to end up being a bug report. Do we want to know
about it sooner or later?

> Obviously, the executable can be corrupted, or not have correct
> permissions,
> or have a run time problem. I didn't know the complete list of possible
> exceptions, so I caught the parent.
>
> I can remove the exception if you want...

Catching Exception always makes me wary, and the reason is because it
often ends up masking real problems - sometimes problems that are
happening way down in a call stack - making them harder to discover and
harder to debug.

If you know of specific problems that can happen, we can catch those
specific problems. But just catching everything is going to end up
biting us.

And yes, I know we do this in tons of places already. I don't like it
in any of those either.

- Chris

_______________________________________________
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 10:48 AM.

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