Skip to content

Commit

Permalink
Support the --checksum-type option and deprecate legacy options
Browse files Browse the repository at this point in the history
--package-checksum-type and --metadata-checksum-type are now deprecated.

closes pulp#850
  • Loading branch information
dralley committed Jan 14, 2024
1 parent 7dd9ad7 commit 103f14d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES/850.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for --checksum-type option (combination of --package-checksum-type and --metadata-checksum-type).
9 changes: 9 additions & 0 deletions pulpcore/cli/rpm/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pulp_glue.common.i18n import get_translation
from pulp_glue.rpm.context import PulpRpmPublicationContext, PulpRpmRepositoryContext

from pulpcore.cli.rpm.common import CHECKSUM_CHOICES
from pulpcore.cli.common.generic import (
PulpCLIContext,
create_command,
Expand Down Expand Up @@ -65,6 +66,14 @@ def publication(ctx: click.Context, pulp_ctx: PulpCLIContext, publication_type:
),
callback=load_json_callback,
),
pulp_option(
"--checksum-type",
type=click.Choice(CHECKSUM_CHOICES, case_sensitive=False),
help=_(
"Option specifying the checksum type to use for package and metadata integrity checks."
),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.25.0")],
),
]
publication.add_command(list_command(decorators=publication_filter_options + [repository_option]))
publication.add_command(show_command(decorators=lookup_options))
Expand Down
23 changes: 19 additions & 4 deletions pulpcore/cli/rpm/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,32 @@ def repository(ctx: click.Context, pulp_ctx: PulpCLIContext, repo_type: str) ->
remote_option,
metadata_signing_service_option,
click.option(
"--metadata-checksum-type", type=click.Choice(CHECKSUM_CHOICES, case_sensitive=False)
"--metadata-checksum-type",
type=click.Choice(CHECKSUM_CHOICES, case_sensitive=False),
help=_("DEPRECATED: Option specifying the checksum type to use for repository metadata."),
),
click.option(
"--package-checksum-type", type=click.Choice(CHECKSUM_CHOICES, case_sensitive=False)
"--package-checksum-type",
type=click.Choice(CHECKSUM_CHOICES, case_sensitive=False),
help=_(
"DEPRECATED: Option specifying the checksum type to use for packages in "
"repository metadata."
),
),
pulp_option(
"--checksum-type",
type=click.Choice(CHECKSUM_CHOICES, case_sensitive=False),
help=_(
"Option specifying the checksum type to use for package and metadata integrity checks."
),
needs_plugins=[PluginRequirement("rpm", specifier=">=3.25.0")],
),
click.option(
"--gpgcheck",
type=click.Choice(("0", "1")),
callback=choice_to_int_callback,
help=_(
"""DEPRECATED:Option specifying whether a client should perform a GPG signature check
"""DEPRECATED: Option specifying whether a client should perform a GPG signature check
on packages."""
),
),
Expand All @@ -163,7 +178,7 @@ def repository(ctx: click.Context, pulp_ctx: PulpCLIContext, repo_type: str) ->
type=click.Choice(("0", "1")),
callback=choice_to_int_callback,
help=_(
"""DEPRECATED:Option specifying whether a client should perform a GPG signature check
"""DEPRECATED: Option specifying whether a client should perform a GPG signature check
on the repodata."""
),
),
Expand Down

0 comments on commit 103f14d

Please sign in to comment.