diff options
| author | Dolph Mathews <dolph.mathews@gmail.com> | 2013-05-23 14:58:01 -0500 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-23 23:48:49 +0000 |
| commit | 47bdec25eb51d2dfbcd28af512cfbd4f4165b332 (patch) | |
| tree | 4ea16c843023941d895df44d70df7f48d470d8a9 | |
| parent | f9b535c84ed22f6831165cb0807029a44a01bddb (diff) | |
| download | keystone-47bdec25eb51d2dfbcd28af512cfbd4f4165b332.tar.gz keystone-47bdec25eb51d2dfbcd28af512cfbd4f4165b332.tar.xz keystone-47bdec25eb51d2dfbcd28af512cfbd4f4165b332.zip | |
eliminate 'except:' (flake8 H201)
Change-Id: Ic53b43b96c490557352be212ac79a7e8a249c21a
| -rw-r--r-- | keystone/common/utils.py | 2 | ||||
| -rw-r--r-- | keystone/identity/backends/ldap/core.py | 5 | ||||
| -rw-r--r-- | tox.ini | 3 |
3 files changed, 3 insertions, 7 deletions
diff --git a/keystone/common/utils.py b/keystone/common/utils.py index 9536cdc7..e35bde01 100644 --- a/keystone/common/utils.py +++ b/keystone/common/utils.py @@ -228,7 +228,7 @@ def setup_remote_pydev_debug(): stdoutToServer=True, stderrToServer=True) return True - except: + except Exception: LOG.exception(_( 'Error setting up the debug environment. Verify that the ' 'option --debug-url has the format <host>:<port> and that a ' diff --git a/keystone/identity/backends/ldap/core.py b/keystone/identity/backends/ldap/core.py index 87e560e0..f5cdc69a 100644 --- a/keystone/identity/backends/ldap/core.py +++ b/keystone/identity/backends/ldap/core.py @@ -855,10 +855,7 @@ class RoleApi(common_ldap.BaseLdap, ApiShimMixin): roles = conn.search_s(dn, ldap.SCOPE_ONELEVEL, query, ['%s' % '1.1']) for role_dn, _ in roles: - try: - conn.delete_s(role_dn) - except: - raise Exception + conn.delete_s(role_dn) except ldap.NO_SUCH_OBJECT: pass @@ -31,7 +31,6 @@ commands = {posargs} [flake8] show-source = true -# H201: no 'except:' at least use 'except Exception:' # H301: one import per line # H302: import only modules # H304: no relative imports. @@ -40,7 +39,7 @@ show-source = true # H402: one line docstring needs punctuation # H403: multi line docstring end on new line # H404: multi line docstring should start with a summary -ignore = H201,H301,H302,H304,H306,H401,H402,H403,H404 +ignore = H301,H302,H304,H306,H401,H402,H403,H404 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,vendor |
