Remove some unnecessary error handling in healthcheck

...as well as an unused class variable.

Change-Id: If1091f420b0bcf34c37e49b13f59b229e8deecc6
This commit is contained in:
Tim Burke 2016-06-29 12:22:22 -07:00
parent 3944d82038
commit 365171395e
1 changed files with 5 additions and 10 deletions

View File

@ -31,7 +31,6 @@ class HealthCheckMiddleware(object):
def __init__(self, app, conf):
self.app = app
self.conf = conf
self.disable_path = conf.get('disable_path', '')
def GET(self, req):
@ -45,15 +44,11 @@ class HealthCheckMiddleware(object):
def __call__(self, env, start_response):
req = Request(env)
try:
if req.path == '/healthcheck':
handler = self.GET
if self.disable_path and os.path.exists(self.disable_path):
handler = self.DISABLED
return handler(req)(env, start_response)
except UnicodeError:
# definitely, this is not /healthcheck
pass
if req.path == '/healthcheck':
handler = self.GET
if self.disable_path and os.path.exists(self.disable_path):
handler = self.DISABLED
return handler(req)(env, start_response)
return self.app(env, start_response)