From aa487415d8f9dad1ec62cd1208cf0ad0f13924f5 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Fri, 11 Aug 2023 15:59:48 +0200 Subject: [PATCH] Fixed crashing pulp domain Providing a default value for --domain lead to the domain subcommand group getting an invalid default_map. fixes #769 --- CHANGES/769.bugfix | 1 + pulpcore/cli/core/domain.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 CHANGES/769.bugfix diff --git a/CHANGES/769.bugfix b/CHANGES/769.bugfix new file mode 100644 index 000000000..2e73afd42 --- /dev/null +++ b/CHANGES/769.bugfix @@ -0,0 +1 @@ +Fixed a crash in `pulp domain` when a default value for `--domain` was provided in the config file. diff --git a/pulpcore/cli/core/domain.py b/pulpcore/cli/core/domain.py index 848a74bca..717f3c402 100644 --- a/pulpcore/cli/core/domain.py +++ b/pulpcore/cli/core/domain.py @@ -21,7 +21,9 @@ _ = translation.gettext -@pulp_group() +# We need to override the default_map, because we may read a default value for the `--domain` +# option from the config file that will collide here. +@pulp_group(name="domain", context_settings={"default_map": {}}) @pass_pulp_context @click.pass_context def domain(ctx: click.Context, pulp_ctx: PulpContext) -> None: