From e3a4de56cf52a1f8ca2e4f7a01f2af306afefb47 Mon Sep 17 00:00:00 2001 From: John Dickinson Date: Sun, 15 Feb 2015 16:08:05 -0800 Subject: [PATCH] filter non-v1 protocols on access log parsing --- slogging/access_processor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/slogging/access_processor.py b/slogging/access_processor.py index bfc920c..5b32c79 100644 --- a/slogging/access_processor.py +++ b/slogging/access_processor.py @@ -104,6 +104,14 @@ class AccessLogProcessor(object): self.logger.debug(_('Invalid path: %(error)s from data: %(log)s') % {'error': e, 'log': repr(raw_log)}) return {} + if version != 'v1': + # "In the wild" places this can be caught are with auth systems + # that use the same endpoint as the rest of the Swift API (eg + # tempauth or swauth). But if the Swift API ever does change, this + # protects that too. + self.logger.debug(_('Unexpected Swift version string: found ' \ + '"%s" expected "v1"') % version) + return {} if container_name is not None: container_name = container_name.split('?', 1)[0] if object_name is not None: