From 111f55203831ce9ffb9dadbf7d842ac891bfdff9 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 22 Feb 2022 17:08:56 +1100 Subject: [PATCH] encrypt-logs: fix a couple of download script issues - The extra "/" in the URL makes the download fail, remove it - The old download python script would output the root on the first line, then relative urls -- hence the loop was starting from 1. This should be 0 here, as we just output the raw urls. - Fix typo in build uuid output Change-Id: I8ff2a38b3117ddcb0d197fe39f2c168b35ab372b --- playbooks/service-codesearch.yaml | 2 +- .../zuul/roles/encrypt-logs/templates/download-logs.sh.j2 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/service-codesearch.yaml b/playbooks/service-codesearch.yaml index 26b555c0dc..4db3845270 100644 --- a/playbooks/service-codesearch.yaml +++ b/playbooks/service-codesearch.yaml @@ -1,4 +1,4 @@ -# NOTE(ianw): 2022-02-22 16:57 AEST : comment to trigger prod run +# NOTE(ianw): 2022-02-22 17:11 AEST : comment to trigger prod run - hosts: "codesearch:!disabled" name: "Configure codesearch" roles: diff --git a/playbooks/zuul/roles/encrypt-logs/templates/download-logs.sh.j2 b/playbooks/zuul/roles/encrypt-logs/templates/download-logs.sh.j2 index 69816933e0..eaba4a1a68 100644 --- a/playbooks/zuul/roles/encrypt-logs/templates/download-logs.sh.j2 +++ b/playbooks/zuul/roles/encrypt-logs/templates/download-logs.sh.j2 @@ -29,7 +29,7 @@ try: for a in base_json['artifacts']: if a['name'] == 'Encrypted logs': url = a['url'] - logfiles = (url + '/' + f for f in a['metadata']['logfiles']) + logfiles = (url + f for f in a['metadata']['logfiles']) for l in logfiles: print(l) @@ -69,8 +69,8 @@ log "Saving logs to ${DOWNLOAD_DIR}" pushd "${DOWNLOAD_DIR}" > /dev/null -log "Getting logs from ${ZUUL_BUILD_ID}" -for (( i=1; i<$len; i++ )); do +log "Getting logs from ${ZUUL_BUILD_UUID}" +for (( i=0; i<$len; i++ )); do file="${files[i]}" printf -v _out " %-80s [ %04d/%04d ]" "${file}" "${i}" $(( len -1 )) log "$_out"