Surpress 404 errors from swift
Because we try swift and then fall back to disk or alternative path names we get a lot of 404's when looking for a log. These are currently filling up apache's error.log from our catch-all exception handler. We still want to catch all exceptions from attempting swift (as these will range from 403's through to the swiftclient not existing) but we want to ignore errors from 404's as they are handled separately. Change-Id: I7c03685dfde12a3c09f9a2a9caca811281779875
This commit is contained in:
parent
03f726cb73
commit
6d7e65df3d
|
@ -137,7 +137,10 @@ class SwiftIterableBuffer(collections.Iterable):
|
|||
swift_config['container'], logname,
|
||||
resp_chunk_size=chunk_size)
|
||||
self.file_headers.update(self.resp_headers)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
# Only print the traceback if the error was anything but a
|
||||
# 404. File not found errors are handled separately.
|
||||
if 'http_status' not in dir(e) or e.http_status != 404:
|
||||
import traceback
|
||||
sys.stderr.write("Error fetching from swift.\n")
|
||||
sys.stderr.write('logname: %s\n' % logname)
|
||||
|
|
Loading…
Reference in New Issue