From 365171395ea10def59d40e7fcc4d0f18c51bbe7b Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 29 Jun 2016 12:22:22 -0700 Subject: [PATCH] Remove some unnecessary error handling in healthcheck ...as well as an unused class variable. Change-Id: If1091f420b0bcf34c37e49b13f59b229e8deecc6 --- swift/common/middleware/healthcheck.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/swift/common/middleware/healthcheck.py b/swift/common/middleware/healthcheck.py index 5b58e46ee2..cfb0b8a0ba 100644 --- a/swift/common/middleware/healthcheck.py +++ b/swift/common/middleware/healthcheck.py @@ -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)