more explicit catch
Change-Id: I9fdc74d26fd830f463c077c912cdcf00eaab1dfa
This commit is contained in:
@@ -17,7 +17,8 @@ import time
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
from swift.common.request_helpers import split_and_validate_path
|
from swift.common.request_helpers import split_and_validate_path
|
||||||
from swift.common.swob import Request, HTTPTooManyBackendRequests
|
from swift.common.swob import Request, HTTPTooManyBackendRequests, \
|
||||||
|
HTTPException
|
||||||
from swift.common.utils import get_logger, non_negative_float, \
|
from swift.common.utils import get_logger, non_negative_float, \
|
||||||
EventletRateLimiter
|
EventletRateLimiter
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ class BackendRateLimitMiddleware(object):
|
|||||||
try:
|
try:
|
||||||
device, partition, _ = split_and_validate_path(req, 1, 3, True)
|
device, partition, _ = split_and_validate_path(req, 1, 3, True)
|
||||||
int(partition) # check it's a valid partition
|
int(partition) # check it's a valid partition
|
||||||
except Exception: # noqa
|
except (ValueError, HTTPException):
|
||||||
# request may not have device/partition e.g. a healthcheck req
|
# request may not have device/partition e.g. a healthcheck req
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user