From 4f0ddc8d6e2a22f31a837f3c8615021a5d346d2d Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 20 Sep 2016 14:07:29 -0400 Subject: [PATCH] Don't exception log for expected 404s in Swift storage Fixes #1850 --- storage/swift.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/swift.py b/storage/swift.py index 808794868..eded1b25f 100644 --- a/storage/swift.py +++ b/storage/swift.py @@ -120,6 +120,11 @@ class SwiftStorage(BaseStorage): path = self._normalize_path(path) try: return self._get_connection().head_object(self._swift_container, path) + except ClientException as ce: + if ce.http_status != 404: + logger.exception('Could not head object at path %s: %s', path, ex) + + return None except Exception as ex: logger.exception('Could not head object at path %s: %s', path, ex) return None