During my playing with pylint, I fixed this issue which allows us to enable additional check in pylint (the nice one).

Patch attached, it should go only to master.
From 547d41f5835e1dd3a4dcf644948ef104cc50c5dc Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Fri, 12 Feb 2016 17:30:10 +0100
Subject: [PATCH] Remove duplicated except

Both exceptions have been catched before, so it is bacically dead code
---
 ipalib/backend.py           | 5 -----
 ipalib/plugins/automount.py | 3 ---
 pylintrc                    | 1 -
 3 files changed, 9 deletions(-)

diff --git a/ipalib/backend.py b/ipalib/backend.py
index 342e17ec5010b546cfb97063cbcddf570c85d70b..1bfb3e401dc0551bed06c4337f05c9f6cfad896e 100644
--- a/ipalib/backend.py
+++ b/ipalib/backend.py
@@ -143,11 +143,6 @@ class Executioner(Backend):
                 'non-public: %s: %s', e.__class__.__name__, str(e)
             )
             error = InternalError()
-        except Exception as e:
-            self.exception(
-                'unhandled exception: %s: %s', e.__class__.__name__, str(e)
-            )
-            error = InternalError()
         destroy_context()
         if error is None:
             return result
diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py
index d673ef9979f2f0e909dd90c436024efb407e1462..7dc00224e845e12a699ea263abbb0edd45ea4bc0 100644
--- a/ipalib/plugins/automount.py
+++ b/ipalib/plugins/automount.py
@@ -491,9 +491,6 @@ class automountlocation_import(LDAPQuery):
                         raise errors.DuplicateEntry(
                             message=_('map %(map)s already exists') % dict(
                                 map=am[1]))
-                except errors.DuplicateEntry:
-                    # This means the same map is used on several mount points.
-                    pass
 
         # Now iterate over the map files and add the keys. To handle
         # continuation lines I'll make a pass through it to skip comments
diff --git a/pylintrc b/pylintrc
index c6f7f457d4b9b8edf6040be2a96380bb9ed526b5..1003e49217ec9761ea5e17d3e965376a0cca1a32 100644
--- a/pylintrc
+++ b/pylintrc
@@ -74,7 +74,6 @@ disable=
     unsubscriptable-object,
     unsupported-membership-test,
     not-an-iterable,
-    duplicate-except,
     singleton-comparison,
     misplaced-comparison-constant,
     consider-using-enumerate,
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to