mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
config: Read both top-level and network-subdir config files.
This lets you have a default, but also a network-specific config. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-changed: Options: `config` and <network>/`config` read by default.
This commit is contained in:
@@ -1782,3 +1782,15 @@ def test_include(node_factory):
|
||||
l1.start()
|
||||
|
||||
assert l1.rpc.listconfigs('alias')['alias'] == 'conf2'
|
||||
|
||||
|
||||
def test_config_in_subdir(node_factory):
|
||||
l1 = node_factory.get_node(start=False)
|
||||
|
||||
subdir = os.path.join(l1.daemon.opts.get("lightning-dir"), "regtest")
|
||||
os.makedirs(subdir)
|
||||
with open(os.path.join(subdir, "config"), 'w') as f:
|
||||
f.write('alias=test_config_in_subdir')
|
||||
l1.start()
|
||||
|
||||
assert l1.rpc.listconfigs('alias')['alias'] == 'test_config_in_subdir'
|
||||
|
||||
Reference in New Issue
Block a user