From a20c139f3d9b4239943d806ebbfdcad337509961 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 31 Jul 2013 11:23:19 -0700 Subject: [PATCH] Handle html log annotations. * modules/openstack_project/files/logstash/log-gearman-worker.py: The annotated logs served by logs-dev and soon to be served to logs.o.o return .txt files gzipped. log-gearman-worker.py needs to check the Content-Type in the reponse headers to see if the txt files were gzipped in order to properly handle this. partial-bug: #1207047 Change-Id: I5981cde145a572a6e3d20e8369e407df151143ff --- modules/openstack_project/files/logstash/log-gearman-worker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/openstack_project/files/logstash/log-gearman-worker.py b/modules/openstack_project/files/logstash/log-gearman-worker.py index 03d7af6c39..a73d800db3 100644 --- a/modules/openstack_project/files/logstash/log-gearman-worker.py +++ b/modules/openstack_project/files/logstash/log-gearman-worker.py @@ -123,6 +123,8 @@ class LogRetriever(threading.Thread): try: logging.debug("Retrieving: " + source_url) r = urllib2.urlopen(source_url) + if 'gzip' in r.info().get('Content-Type', ''): + gzipped = True except urllib2.URLError: try: logging.debug("Retrieving: " + source_url + ".gz")