Dump config with aprsd dev test-plugin

This patch adds the dumping of the config read for the
aprsd dev test-plugin command
This commit is contained in:
Hemna 2022-11-23 12:52:16 -05:00
parent 075078b520
commit fc1ca52593
1 changed files with 9 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import logging
import click
# local imports here
from aprsd import cli_helper, client, messaging, packets, plugin, stats
from aprsd import cli_helper, client, messaging, packets, plugin, stats, utils
from aprsd.aprsd import cli
from aprsd.utils import trace
@ -70,6 +70,14 @@ def test_plugin(
"""Test an individual APRSD plugin given a python path."""
config = ctx.obj["config"]
flat_config = utils.flatten_dict(config)
LOG.info("Using CONFIG values:")
for x in flat_config:
if "password" in x or "aprsd.web.users.admin" in x:
LOG.info(f"{x} = XXXXXXXXXXXXXXXXXXX")
else:
LOG.info(f"{x} = {flat_config[x]}")
if not aprs_login:
if not config.exists("aprs.login"):
click.echo("Must set --aprs_login or APRS_LOGIN")