Skip to content

Commit

Permalink
Teach pulp-rpm-repository about retain-package-versions.
Browse files Browse the repository at this point in the history
closes #172
  • Loading branch information
ggainey committed Mar 11, 2021
1 parent ea2a574 commit e42e1c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/172.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Taught rpm/repository about the retain-package-versions attribute.
2 changes: 2 additions & 0 deletions pulpcore/cli/rpm/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ def repository(ctx: click.Context, pulp_ctx: PulpContext, repo_type: str) -> Non
create_options = [
click.option("--name", required=True),
click.option("--description"),
click.option("--retain-package-versions", type=int),
click.option("--remote", callback=_remote_callback),
]
update_options = [
click.option("--description"),
click.option("--retain-package-versions", type=int),
click.option("--remote", callback=_remote_callback),
]

Expand Down
8 changes: 6 additions & 2 deletions tests/scripts/pulp_rpm/test_rpm_sync_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
pulp debug has-plugin --name "rpm" || exit 3

cleanup() {
pulp rpm remote destroy --name "cli_test_rpm_remote" || true
pulp rpm repository destroy --name "cli_test_rpm_repository" || true
pulp rpm distribution destroy --name "cli_test_rpm_distro" || true
pulp rpm repository destroy --name "cli_test_rpm_repository" || true
pulp rpm remote destroy --name "cli_test_rpm_remote" || true
}
trap cleanup EXIT

Expand Down Expand Up @@ -40,6 +40,10 @@ expect_succ curl "$curl_opt" --head --fail "$PULP_BASE_URL/pulp/content/cli_test
expect_succ pulp rpm repository version list --repository "cli_test_rpm_repository"
expect_succ pulp rpm repository version repair --repository "cli_test_rpm_repository" --version 1

expect_succ pulp rpm repository update --name "cli_test_rpm_repository" --retain-package-versions 2
expect_succ pulp rpm repository show --name "cli_test_rpm_repository"
test "$(echo "$OUTPUT" | jq -r '.retain_package_versions')" = "2"

expect_succ pulp rpm distribution destroy --name "cli_test_rpm_distro"
expect_succ pulp rpm publication destroy --href "$PUBLICATION_HREF"
expect_succ pulp rpm publication destroy --href "$PUBLICATION_VER_HREF"
Expand Down

0 comments on commit e42e1c1

Please sign in to comment.