[5.2] 97c02d2 Accommodate older python version

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Thu Sep 7 06:59:08 UTC 2017


commit 97c02d22e03cb9d5ca2c462920399a0b60d50c82
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Sep 5 22:43:41 2017 +0100

    Accommodate older python version
    
    I'm looking at you, EL6.

diff --git a/lib/libvcc/vsctool.py b/lib/libvcc/vsctool.py
index 2d39f7b..d21e06b 100644
--- a/lib/libvcc/vsctool.py
+++ b/lib/libvcc/vsctool.py
@@ -39,6 +39,7 @@ import sys
 import gzip
 import StringIO
 import collections
+import struct
 
 TYPES = [ "counter", "gauge", "bitmap" ]
 CTYPES = [ "uint64_t" ]
@@ -55,7 +56,9 @@ PARAMS = {
 
 def gzip_str(s):
 	out = StringIO.StringIO()
-	gzip.GzipFile(fileobj=out, mode="w", mtime=0x12bfd58).write(s)
+	gzip.GzipFile(fileobj=out, mode="w").write(s)
+	out.seek(4)
+	out.write(struct.pack("<L", 0x12bfd58))
 	return out.getvalue()
 
 def genhdr(fo, name):


More information about the varnish-commit mailing list