File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import argparse
10
10
from collections import defaultdict , namedtuple
11
- import glob
12
11
import heapq
13
12
import itertools
14
13
import os
@@ -78,10 +77,11 @@ def read_logs(tmp_dir):
78
77
for each of the input log files."""
79
78
80
79
# Find out what the folder is called that holds the debug.log file
81
- chain = glob .glob ("{}/node0/*/debug.log" .format (tmp_dir ))
82
- if chain :
83
- chain = chain [0 ] # pick the first one if more than one chain was found (should never happen)
84
- chain = re .search (r'node0/(.+?)/debug\.log$' , chain ).group (1 ) # extract the chain name
80
+ glob = pathlib .Path (tmp_dir ).glob ('node0/**/debug.log' )
81
+ path = next (glob , None )
82
+ if path :
83
+ assert next (glob , None ) is None # more than one debug.log, should never happen
84
+ chain = re .search (r'node0/(.+?)/debug\.log$' , path .as_posix ()).group (1 ) # extract the chain name
85
85
else :
86
86
chain = 'regtest' # fallback to regtest (should only happen when none exists)
87
87
You can’t perform that action at this time.
0 commit comments