Skip to content

Commit f34c8a1

Browse files
daviddavismdellweg
authored andcommitted
Add support for checkpoint distributions and publications
fixes #1129
1 parent 5ed783f commit f34c8a1

File tree

6 files changed

+42
-3
lines changed

6 files changed

+42
-3
lines changed

CHANGES/1129.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added support for checkpoint distributions and publications.

pulpcore/cli/file/distribution.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import click
2+
from pulp_glue.common.context import PluginRequirement
23
from pulp_glue.common.i18n import get_translation
3-
from pulp_glue.file.context import PulpFileDistributionContext, PulpFileRepositoryContext
4+
from pulp_glue.file.context import (
5+
PulpFileDistributionContext,
6+
PulpFileRepositoryContext,
7+
)
48

59
from pulp_cli.generic import (
610
PulpCLIContext,
@@ -17,6 +21,7 @@
1721
pass_pulp_context,
1822
pulp_group,
1923
pulp_labels_option,
24+
pulp_option,
2025
resource_option,
2126
role_command,
2227
show_command,
@@ -71,6 +76,13 @@ def distribution(ctx: click.Context, pulp_ctx: PulpCLIContext, /, distribution_t
7176
repository_option,
7277
content_guard_option,
7378
pulp_labels_option,
79+
pulp_option(
80+
"--checkpoint/--not-checkpoint",
81+
is_flag=True,
82+
default=None,
83+
help=_("Create a checkpoint distribution."),
84+
needs_plugins=[PluginRequirement("core", specifier=">=3.74.0")],
85+
),
7486
]
7587
create_options = common_distribution_create_options + update_options
7688

pulpcore/cli/file/publication.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import click
2+
from pulp_glue.common.context import PluginRequirement
23
from pulp_glue.common.i18n import get_translation
3-
from pulp_glue.file.context import PulpFilePublicationContext, PulpFileRepositoryContext
4+
from pulp_glue.file.context import (
5+
PulpFilePublicationContext,
6+
PulpFileRepositoryContext,
7+
)
48

59
from pulp_cli.generic import (
610
PulpCLIContext,
@@ -11,6 +15,7 @@
1115
pass_pulp_context,
1216
publication_filter_options,
1317
pulp_group,
18+
pulp_option,
1419
resource_option,
1520
role_command,
1621
show_command,
@@ -56,6 +61,13 @@ def publication(ctx: click.Context, pulp_ctx: PulpCLIContext, /, publication_typ
5661
"--manifest",
5762
help=_("Filename to use for manifest file containing metadata for all the files."),
5863
),
64+
pulp_option(
65+
"--checkpoint",
66+
is_flag=True,
67+
default=None,
68+
help=_("Create a checkpoint publication"),
69+
needs_plugins=[PluginRequirement("core", specifier=">=3.74.0")],
70+
),
5971
]
6072
publication.add_command(list_command(decorators=publication_filter_options + [repository_option]))
6173
publication.add_command(show_command(decorators=lookup_options))

pulpcore/cli/rpm/distribution.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import click
2+
from pulp_glue.common.context import PluginRequirement
23
from pulp_glue.common.i18n import get_translation
34
from pulp_glue.rpm.context import PulpRpmDistributionContext, PulpRpmRepositoryContext
45

@@ -76,6 +77,12 @@ def distribution(ctx: click.Context, pulp_ctx: PulpCLIContext, /, distribution_t
7677
repository_option,
7778
content_guard_option,
7879
pulp_labels_option,
80+
pulp_option(
81+
"--checkpoint/--not-checkpoint",
82+
is_flag=True,
83+
default=None,
84+
needs_plugins=[PluginRequirement("rpm", specifier=">=3.29.0")],
85+
),
7986
]
8087
create_options = common_distribution_create_options + update_options
8188

pulpcore/cli/rpm/publication.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ def publication(ctx: click.Context, pulp_ctx: PulpCLIContext, /, publication_typ
7474
),
7575
needs_plugins=[PluginRequirement("rpm", specifier=">=3.25.0")],
7676
),
77+
pulp_option(
78+
"--checkpoint",
79+
is_flag=True,
80+
default=None,
81+
help=_("Create a checkpoint publication"),
82+
needs_plugins=[PluginRequirement("rpm", specifier=">=3.29.0")],
83+
),
7784
]
7885
publication.add_command(list_command(decorators=publication_filter_options + [repository_option]))
7986
publication.add_command(show_command(decorators=lookup_options))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ exclude = "cookiecutter"
207207
# This section is managed by the cookiecutter templates.
208208
profile = "black"
209209
line_length = 100
210-
skip = ["pulp-glue", "cookiecutter"]
210+
extend_skip = ["pulp-glue", "cookiecutter"]
211211

212212
[tool.flake8]
213213
# This section is managed by the cookiecutter templates.

0 commit comments

Comments
 (0)