From 38eb12361e745999b6b3221454c555ee933e2ed5 Mon Sep 17 00:00:00 2001 From: David Davis Date: Thu, 20 Mar 2025 07:43:06 -0400 Subject: [PATCH] Add checkpoint options fixes #168 --- CHANGES/168.feature | 1 + pulpcore/cli/deb/distribution.py | 14 +++++++++++++- pulpcore/cli/deb/publication.py | 10 ++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 CHANGES/168.feature diff --git a/CHANGES/168.feature b/CHANGES/168.feature new file mode 100644 index 0000000..2c585c1 --- /dev/null +++ b/CHANGES/168.feature @@ -0,0 +1 @@ +Added checkpoint options to publication and distribution commands. diff --git a/pulpcore/cli/deb/distribution.py b/pulpcore/cli/deb/distribution.py index 2684e33..b23d85a 100644 --- a/pulpcore/cli/deb/distribution.py +++ b/pulpcore/cli/deb/distribution.py @@ -1,7 +1,11 @@ import gettext import click -from pulp_glue.deb.context import PulpAptDistributionContext, PulpAptRepositoryContext +from pulp_glue.common.context import PluginRequirement +from pulp_glue.deb.context import ( + PulpAptDistributionContext, + PulpAptRepositoryContext, +) from pulpcore.cli.common.generic import ( PulpCLIContext, base_path_contains_option, @@ -14,6 +18,7 @@ list_command, name_option, pass_pulp_context, + pulp_option, resource_option, show_command, update_command, @@ -32,6 +37,12 @@ " Specified as '[[:]:]' or as href." ), ) +checkpoint_option = pulp_option( + "--checkpoint/--not-checkpoint", + is_flag=True, + default=None, + needs_plugins=[PluginRequirement("deb", specifier=">=3.6.0")], +) @click.group() @@ -57,6 +68,7 @@ def distribution(ctx: click.Context, pulp_ctx: PulpCLIContext, /, distribution_t click.option("--base-path"), click.option("--publication", help=_("Publication to be served.")), repository_option, + checkpoint_option, ] create_options = update_options + [click.option("--name", required=True)] diff --git a/pulpcore/cli/deb/publication.py b/pulpcore/cli/deb/publication.py index 3629153..63f10a1 100644 --- a/pulpcore/cli/deb/publication.py +++ b/pulpcore/cli/deb/publication.py @@ -1,6 +1,7 @@ import gettext import click +from pulp_glue.common.context import PluginRequirement from pulp_glue.core.context import PulpSigningServiceContext from pulp_glue.deb.context import ( PulpAptPublicationContext, @@ -15,6 +16,7 @@ list_command, pass_pulp_context, publication_filter_options, + pulp_option, resource_option, show_command, ) @@ -28,6 +30,13 @@ default_type="apt", context_table={"deb:apt": PulpAptRepositoryContext}, ) +checkpoint_option = pulp_option( + "--checkpoint", + is_flag=True, + default=None, + help=_("Create a checkpoint publication"), + needs_plugins=[PluginRequirement("deb", specifier=">=3.6.0")], +) @click.group() @@ -52,6 +61,7 @@ def publication(ctx: click.Context, pulp_ctx: PulpCLIContext, /, publication_typ lookup_options = [href_option] create_options = [ repository_option, + checkpoint_option, click.option( "--version", type=int, help=_("a repository version number, leave blank for latest") ),