style(pep8): remove E722 exclusion

This patch set removes E722 pep8 exclusion that allows for "bare"
except: statement.

Change-Id: Icdce885366541b88aabbef35166cf196a588676b
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2018-05-08 23:03:16 -05:00
parent 2b714888c4
commit 8d1521e96c
6 changed files with 6 additions and 6 deletions

View File

@ -86,7 +86,7 @@ class ContextMiddleware(object):
def is_valid_uuid(self, id, version=4):
try:
uuid_obj = UUID(id, version=version)
except:
except (TypeError, ValueError):
return False
return str(uuid_obj) == id

View File

@ -41,7 +41,7 @@ class CliAction(object):
except ArmadaBaseException:
self.logger.exception('Caught internal exception')
sys.exit(1)
except:
except Exception:
self.logger.exception('Caught unexpected exception')
sys.exit(1)

View File

@ -41,7 +41,7 @@ class K8s(object):
'''
try:
config.load_incluster_config()
except:
except config.config_exception.ConfigException:
config.load_kube_config()
self.client = client.CoreV1Api()

View File

@ -35,7 +35,7 @@ def is_connected():
host = socket.gethostbyname("www.github.com")
socket.create_connection((host, 80), 2)
return True
except:
except (socket.error, socket.herror, socket.timeout):
pass
return False

View File

@ -229,7 +229,7 @@ def validate_armada_documents(documents):
def validate_manifest_url(value):
try:
return (requests.get(value).status_code == 200)
except:
except requests.exceptions.RequestException:
return False

View File

@ -55,5 +55,5 @@ commands =
[flake8]
filename = *.py
ignore = E722
ignore =
exclude = .git,.tox,dist,*lib/python*,*egg,build,releasenotes,docs/*,hapi,venv