Skip to content

Commit

Permalink
pyln: Allow non-empty directory when creating node in node_factory
Browse files Browse the repository at this point in the history
So far we've always cleared the node directory when provisioning the node, but
while testing some plugins we noticed that pre-generating some files in that
directory is useful. This just adds yet another flag to `get_node` that
disables deleting any existing node directory.
  • Loading branch information
cdecker committed Apr 8, 2020
1 parent 65eb9d8 commit 5fda7ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,15 +1011,16 @@ def get_nodes(self, num_nodes, opts=None):

def get_node(self, node_id=None, options=None, dbfile=None,
feerates=(15000, 11000, 7500, 3750), start=True,
wait_for_bitcoind_sync=True, expect_fail=False, **kwargs):
wait_for_bitcoind_sync=True, expect_fail=False,
cleandir=True, **kwargs):

node_id = self.get_node_id() if not node_id else node_id
port = self.get_next_port()

lightning_dir = os.path.join(
self.directory, "lightning-{}/".format(node_id))

if os.path.exists(lightning_dir):
if cleandir and os.path.exists(lightning_dir):
shutil.rmtree(lightning_dir)

# Get the DB backend DSN we should be using for this test and this
Expand Down

0 comments on commit 5fda7ee

Please sign in to comment.