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
12-16-2009, 03:05 PM
Chris Lumens
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
12-16-2009, 04:10 PM
Mark Hamzy
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
12-17-2009, 01:19 PM
Chris Lumens
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