From 381371c251172b9a0a915e9d0632561b7d5c6d48 Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Fri, 12 Dec 2014 18:14:42 +1100 Subject: [PATCH] Add extra detail to swift indexes To have feature parity with apache's mod_autoindex generate the extra information we need when pushing the results (filesize etc). Change-Id: Ic0b0c9f4d3e28fc01ace9d8d3dd97ea86bddf526 --- jenkins/scripts/zuul_swift_upload.py | 103 ++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 16 deletions(-) diff --git a/jenkins/scripts/zuul_swift_upload.py b/jenkins/scripts/zuul_swift_upload.py index 8a46ac8bbb..58321e04a7 100755 --- a/jenkins/scripts/zuul_swift_upload.py +++ b/jenkins/scripts/zuul_swift_upload.py @@ -23,6 +23,7 @@ import argparse import magic import os import requests +import stat import sys import tempfile import time @@ -40,36 +41,64 @@ import time # in swift, is typically the rel path to the file # list supplied, # 'url': The URL to the log on the log server (absolute, supplied -# by logserver_prefix and swift_destination_prefix) +# by logserver_prefix and swift_destination_prefix), +# 'metadata': { +# 'mime': The filetype/mime, +# 'last_modified': Modification timestamp, +# 'size': The filesize in bytes, +# } # } -def generate_log_index(folder_links): +def generate_log_index(folder_links, header_message=''): """Create an index of logfiles and links to them""" output = 'Index of results\n' - output += '