[blivet:master 4/4] Log exception information and disable W0703 warning.

Vratislav Podzimek vpodzime at redhat.com
Tue Apr 22 10:59:21 UTC 2014


On Thu, 2014-04-17 at 16:18 -0400, mulhern wrote:
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  blivet/__init__.py     | 8 +++++++-
>  blivet/deviceaction.py | 8 +++++++-
>  blivet/iscsi.py        | 3 ++-
>  3 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/blivet/__init__.py b/blivet/__init__.py
> index 2b47a47..876ec55 100644
> --- a/blivet/__init__.py
> +++ b/blivet/__init__.py
> @@ -2248,7 +2248,9 @@ class CryptTab(object):
>                  try:
>                      self.blkidTab = BlkidTab(chroot=chroot)
>                      self.blkidTab.parse()
> +                # pylint: disable=W0703
>                  except Exception:
> +                    log_exception_info(sys.exc_info(), fmt_str="failed to parse blkid.tab")
>                      self.blkidTab = None
>  
>              for line in f.readlines():
> @@ -2324,7 +2326,9 @@ def get_containing_device(path, devicetree):
>  
>      try:
>          device_name = os.path.basename(os.readlink(link))
> +    # pylint: disable=W0703
>      except Exception:
> +        log_exception_info(sys.exc_info(), fmt_str="failed to find device name for path %s", fmt_args=[path])
>          return None
>  
>      if device_name.startswith("dm-"):
> @@ -2685,7 +2689,9 @@ class FSSet(object):
>  
>              try:
>                  device.setup()
> -            except Exception as e:
> +            # pylint: disable=W0703
> +            except Exception:
> +                log_exception_info(sys.exc_info(), fmt_str="unable to set up device %s", fmt_args=[device])
>                  if errorHandler.cb(e) == ERROR_RAISE:
>                      raise
>                  else:
> diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py
> index 4a50a1a..3eece88 100644
> --- a/blivet/deviceaction.py
> +++ b/blivet/deviceaction.py
> @@ -20,6 +20,7 @@
>  # Red Hat Author(s): Dave Lehman <dlehman at redhat.com>
>  #
>  
> +
No extra line needed here.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list