File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -79,11 +79,12 @@ def read_logs(tmp_dir):
79
79
Delegates to generator function get_log_events() to provide individual log events
80
80
for each of the input log files."""
81
81
82
- # Find out what the folder is called that holds the debug.log file
83
- glob = pathlib .Path (tmp_dir ).glob ('node0/**/debug.log' )
84
- path = next (glob , None )
85
- if path :
86
- assert next (glob , None ) is None # more than one debug.log, should never happen
82
+ # Find out what the folder is called that holds node 0's debug.log file
83
+ debug_logs = list (pathlib .Path (tmp_dir ).glob ('node0/**/debug.log' ))
84
+ if len (debug_logs ) > 0 :
85
+ assert len (debug_logs ) < 2 , 'Max one debug.log is supported, ' \
86
+ 'found several:\n \t ' + '\n \t ' .join ([str (f ) for f in debug_logs ])
87
+ path = debug_logs [0 ]
87
88
chain = re .search (r'node0/(.+?)/debug\.log$' , path .as_posix ()).group (1 ) # extract the chain name
88
89
else :
89
90
chain = 'regtest' # fallback to regtest (should only happen when none exists)
You can’t perform that action at this time.
0 commit comments