Skip to content

Commit

Permalink
Fix server error when using gpgcheck/repo_gpgcheck
Browse files Browse the repository at this point in the history
pulp#3298 moved gpg options to a single
field called "repo_config", but the deprecated "gpgcheck" and "repo_gpgcheck"
were still being passed to the models, which caused a TypeError when trying
to use them.

closes pulp#3357
  • Loading branch information
pedro-psb committed Jan 2, 2024
1 parent 46a76ea commit 04b238d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/3357.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed server error when trying to create repository with deprecated `gpgcheck` and `repo_gpgcheck`.
2 changes: 2 additions & 0 deletions pulp_rpm/app/serializers/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class RpmRepositorySerializer(RepositorySerializer):
"DEPRECATED: An option specifying whether a client should perform "
"a GPG signature check on packages."
),
read_only=True,
)
repo_gpgcheck = serializers.IntegerField(
max_value=1,
Expand All @@ -115,6 +116,7 @@ class RpmRepositorySerializer(RepositorySerializer):
"DEPRECATED: An option specifying whether a client should perform "
"a GPG signature check on the repodata."
),
read_only=True,
)
sqlite_metadata = serializers.BooleanField(
default=False,
Expand Down
5 changes: 5 additions & 0 deletions pulp_rpm/tests/functional/api/test_crud_repository.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def test_create_repo_with_deprecated_gpg_options_3357(rpm_repository_factory):
"""Can create repository with deprecated gpgcheck and repo_gpgcheck options."""
assert rpm_repository_factory(repo_gpgcheck="0")
assert rpm_repository_factory(gpgcheck="0")
assert rpm_repository_factory(gpgcheck="0", repo_gpgcheck="0")

0 comments on commit 04b238d

Please sign in to comment.