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 #850
  • Loading branch information
dralley authored and mdellweg committed Jan 15, 2024
1 parent ef11dc3 commit c2fc91b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 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`) when creating rpm publications and configuring rpm repository publish settings.
2 changes: 1 addition & 1 deletion CHANGES/pulp-glue/851.removal
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pulp_rpm 3.25+ no longer allows publishing repositories with md5, sha1, or sha224 checksums.
Adjusted to `pulp_rpm>=3.25` no longer allowing publishing repositories with md5, sha1, or sha224 checksums.
9 changes: 9 additions & 0 deletions pulpcore/cli/rpm/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
role_command,
show_command,
)
from pulpcore.cli.rpm.common import CHECKSUM_CHOICES

translation = get_translation(__name__)
_ = translation.gettext
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 c2fc91b

Please sign in to comment.