[PATCH 1/2] Fix pylint errors in the latest dnf-related commit.

David Shea dshea at redhat.com
Mon Feb 17 16:35:21 UTC 2014


On 02/17/2014 11:30 AM, Chris Lumens wrote:
> ---
>   pyanaconda/anaconda.py             | 1 +
>   pyanaconda/packaging/dnfpayload.py | 3 ++-
>   2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py
> index c23630c..a2662e7 100644
> --- a/pyanaconda/anaconda.py
> +++ b/pyanaconda/anaconda.py
> @@ -123,6 +123,7 @@ class Anaconda(object):
>                       try:
>                           from pyanaconda.packaging.dnfpayload import DNFPayload
>                           klass = DNFPayload
> +                    # pylint: disable-msg=W0703
>                       except Exception:
>                           log.critical('Importing DNF  failed.', exc_info=True)
>                   else:

This could catch ImportError instead of Exception, unless I'm 
misunderstanding something in dnf.py (and if dnf.py does throw something 
else during import it probably needs to knock it off).

> diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
> index ad8120e..abf7e12 100644
> --- a/pyanaconda/packaging/dnfpayload.py
> +++ b/pyanaconda/packaging/dnfpayload.py
> @@ -28,6 +28,7 @@ from pyanaconda.progress import progressQ
>   import itertools
>   import logging
>   import multiprocessing
> +import operator
>   import pyanaconda.constants as constants
>   import pyanaconda.errors as errors
>   import pyanaconda.iutil
> @@ -91,7 +92,7 @@ def _pick_mpoint(df, requested):
>       requested = requested + Size(en_spec="150 MB")
>       sufficients = {key : val for (key,val) in df.items() if val > requested
>                      and reasonable_mpoint(key)}
> -    log.info('Sufficient mountpoints found: %s' % sufficients)
> +    log.info('Sufficient mountpoints found: %s', sufficients)
>   
>       # prefer /tmp:
>       if '/tmp' in sufficients:

All this looks good, along with the other patch


More information about the anaconda-patches mailing list