[PATCH 3/3] DNFPayload: error handling and logging cleanups.

Vratislav Podzimek vpodzime at redhat.com
Mon Oct 14 11:53:08 UTC 2013


On Mon, 2013-10-14 at 12:29 +0200, Ales Kozumplik wrote:
> On 10/14/2013 09:37 AM, Vratislav Podzimek wrote:
> >> >+        if token == 'quit':
> >> >+            progressQ.send_quit(1)
> >> >+            sys.exit(1)
> > The installation thread shouldn't exit the process. It should just send
> > the quit message and wait for the main thread to quit the process. I
> > know we have both things in the yumpayload.py module, but those
> > sys.exit() calls are bugs (I'll send a patch soon). Just replace it
> > with:
> >
> > while True:
> >      time.sleep(10000)
> >
> > Otherwise these all look good to me.
> 
> It looked odd but I couldn't figure out what the right thing to do was. 
> I'll take your word for the endless loop then, will meld it into the 
> original commit:
> 
> diff --git a/pyanaconda/packaging/dnfpayload.py 
> b/pyanaconda/packaging/dnfpayload.py
> index fe84e7f..d0bda57 100644
> --- a/pyanaconda/packaging/dnfpayload.py
> +++ b/pyanaconda/packaging/dnfpayload.py
> @@ -32,6 +32,7 @@ import pyanaconda.constants as constants
>   import pyanaconda.errors as errors
>   import pyanaconda.packaging as packaging
>   import sys
> +import time
> 
>   log = logging.getLogger("packaging")
> 
> @@ -52,6 +53,11 @@ REPO_DIRS = ['/etc/yum.repos.d',
>                '/tmp/updates/anaconda.repos.d',
>                '/tmp/product/anaconda.repos.d']
> 
> +def _failure_limbo():
> +    progressQ.send_quit(1)
> +    while True:
> +        time.sleep(10000)
The installation thread shoudn't exit the process, but it shouldn't do
any other actions. I'll send a patch to deal with those cases in a nice
and better way -- raising an exception.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list