Skip to content

Commit ce396d3

Browse files
committed
Fix worlddump log collection
All credit for figuring this out goes to frickler (and that was the hard bit so thank you!). The worlddump files were not being collected because they weren't in our log collection list. Add worlddump to this list so that we collect these files. One thing that makes this slightly complicated is the worlddump files are named with a timestamp and we can't have globs in our collection list. To address this we create a copy of the file with a -latest.txt suffix. This gives us a deterministic file name for log collection without using globs. Note we do not use a symlink here because some jobs gzip their log files (breaking symlinks) and others do not. This makes it painful to always have a valid link. Not having a valid link can break log collection. Hardlinks may be another option but simply making a copy is easier to manage as you don't have to worry about links preexisting and the dumpfiles are not that large. Change-Id: I96ae5f5290546ad25ca434c1106c01354d2d053c
1 parent 650769a commit ce396d3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.zuul.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
'{{ devstack_log_dir }}/devstacklog.txt': logs
234234
'{{ devstack_log_dir }}/devstacklog.txt.summary': logs
235235
'{{ devstack_log_dir }}/tcpdump.pcap': logs
236+
'{{ devstack_log_dir }}/worlddump-latest.txt': logs
236237
'{{ devstack_full_log}}': logs
237238
'{{ stage_dir }}/verify_tempest_conf.log': logs
238239
'{{ stage_dir }}/apache': logs

tools/worlddump.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import fnmatch
2626
import os
2727
import os.path
28+
import shutil
2829
import subprocess
2930
import sys
3031

@@ -248,6 +249,14 @@ def main():
248249
compute_consoles()
249250
guru_meditation_reports()
250251
var_core()
252+
# Singular name for ease of log retrieval
253+
copyname = os.path.join(opts.dir, 'worlddump')
254+
if opts.name:
255+
copyname += '-' + opts.name
256+
copyname += '-latest.txt'
257+
# We make a full copy to deal with jobs that may or may not
258+
# gzip logs breaking symlinks.
259+
shutil.copyfile(fname, copyname)
251260

252261

253262
if __name__ == '__main__':

0 commit comments

Comments
 (0)