mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge d5a770b70d into merged_master (Bitcoin PR #16973)
This commit is contained in:
commit
14a79b024a
1 changed files with 5 additions and 5 deletions
|
|
@ -8,7 +8,6 @@ If no argument is provided, the most recent test directory will be used."""
|
|||
|
||||
import argparse
|
||||
from collections import defaultdict, namedtuple
|
||||
import glob
|
||||
import heapq
|
||||
import itertools
|
||||
import os
|
||||
|
|
@ -79,10 +78,11 @@ def read_logs(tmp_dir, chain):
|
|||
for each of the input log files."""
|
||||
|
||||
# Find out what the folder is called that holds the debug.log file
|
||||
chain = glob.glob("{}/node0/*/debug.log".format(tmp_dir))
|
||||
if chain:
|
||||
chain = chain[0] # pick the first one if more than one chain was found (should never happen)
|
||||
chain = re.search(r'node0/(.+?)/debug\.log$', chain).group(1) # extract the chain name
|
||||
glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log')
|
||||
path = next(glob, None)
|
||||
if path:
|
||||
assert next(glob, None) is None # more than one debug.log, should never happen
|
||||
chain = re.search(r'node0/(.+?)/debug\.log$', path.as_posix()).group(1) # extract the chain name
|
||||
else:
|
||||
chain = 'regtest' # fallback to regtest (should only happen when none exists)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue