EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 72b44ea0 authored by Fabian Schindler's avatar Fabian Schindler
Browse files

Fixing command context instance

parent 09ca05e4
No related branches found
No related tags found
1 merge request!15Registration routes
Pipeline #26209 passed
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment