Skip to content

Commit 4fe86ef

Browse files
authored
Merge pull request #169 from daviddavis/checkpoint
Add checkpoint options
2 parents fddddc8 + 38eb123 commit 4fe86ef

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

CHANGES/168.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added checkpoint options to publication and distribution commands.

pulpcore/cli/deb/distribution.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import gettext
22

33
import click
4-
from pulp_glue.deb.context import PulpAptDistributionContext, PulpAptRepositoryContext
4+
from pulp_glue.common.context import PluginRequirement
5+
from pulp_glue.deb.context import (
6+
PulpAptDistributionContext,
7+
PulpAptRepositoryContext,
8+
)
59
from pulpcore.cli.common.generic import (
610
PulpCLIContext,
711
base_path_contains_option,
@@ -14,6 +18,7 @@
1418
list_command,
1519
name_option,
1620
pass_pulp_context,
21+
pulp_option,
1722
resource_option,
1823
show_command,
1924
update_command,
@@ -32,6 +37,12 @@
3237
" Specified as '[[<plugin>:]<type>:]<name>' or as href."
3338
),
3439
)
40+
checkpoint_option = pulp_option(
41+
"--checkpoint/--not-checkpoint",
42+
is_flag=True,
43+
default=None,
44+
needs_plugins=[PluginRequirement("deb", specifier=">=3.6.0")],
45+
)
3546

3647

3748
@click.group()
@@ -57,6 +68,7 @@ def distribution(ctx: click.Context, pulp_ctx: PulpCLIContext, /, distribution_t
5768
click.option("--base-path"),
5869
click.option("--publication", help=_("Publication to be served.")),
5970
repository_option,
71+
checkpoint_option,
6072
]
6173
create_options = update_options + [click.option("--name", required=True)]
6274

pulpcore/cli/deb/publication.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import gettext
22

33
import click
4+
from pulp_glue.common.context import PluginRequirement
45
from pulp_glue.core.context import PulpSigningServiceContext
56
from pulp_glue.deb.context import (
67
PulpAptPublicationContext,
@@ -15,6 +16,7 @@
1516
list_command,
1617
pass_pulp_context,
1718
publication_filter_options,
19+
pulp_option,
1820
resource_option,
1921
show_command,
2022
)
@@ -28,6 +30,13 @@
2830
default_type="apt",
2931
context_table={"deb:apt": PulpAptRepositoryContext},
3032
)
33+
checkpoint_option = pulp_option(
34+
"--checkpoint",
35+
is_flag=True,
36+
default=None,
37+
help=_("Create a checkpoint publication"),
38+
needs_plugins=[PluginRequirement("deb", specifier=">=3.6.0")],
39+
)
3140

3241

3342
@click.group()
@@ -52,6 +61,7 @@ def publication(ctx: click.Context, pulp_ctx: PulpCLIContext, /, publication_typ
5261
lookup_options = [href_option]
5362
create_options = [
5463
repository_option,
64+
checkpoint_option,
5565
click.option(
5666
"--version", type=int, help=_("a repository version number, leave blank for latest")
5767
),

0 commit comments

Comments
 (0)