diff --git a/registrar/cli.py b/registrar/cli.py index 6b7fb32bd5d16bce3dcf6279122add7a94cf0750..567308ff82db4c236ff9984af562e0d48847e1c2 100644 --- a/registrar/cli.py +++ b/registrar/cli.py @@ -71,10 +71,11 @@ def cli( ctx, config_file=None, validate=False, host=None, port=None, debug=False ): """Entry point for the registar""" + ctx.ensure_object(dict) + setup_logging(debug) # ensure that ctx.obj exists and is a dict (in case `cli()` is called # by means other than the `if` block below) - ctx.ensure_object(dict) config = RegistrarConfig.from_file(config_file, validate) if host: @@ -104,7 +105,7 @@ def daemon(ctx, replace=False): daemon --replace """ - config: RegistrarConfig = ctx["CONFIG"] + config: RegistrarConfig = ctx.obj["CONFIG"] if replace is not None: for route in config.routes.values(): @@ -131,12 +132,12 @@ def register(ctx, route_name, item, replace): --debug \ register --replace myroute "{...}" """ - config: RegistrarConfig = ctx["CONFIG"] + config: RegistrarConfig = ctx.obj["CONFIG"] if replace is not None: for route in config.routes.values(): route.replace = replace - registrar.register(config.routes[route_name], item) + registrar.register(config.routes[route_name], config.sources, item) @cli.command(help="Run a single, one-off de-registration")