Skip to content

Commit

Permalink
Fixes #37974 - support keep-latest-packages in python (#11202)
Browse files Browse the repository at this point in the history
* Fixes #37974 - support keep-latest-packages in python
   The pulp python backend supports keep-latest-packages. This should be
   available on the UI, too.

* Fixes generic_remote_options if there is no delimiter
  • Loading branch information
sbernhard authored Nov 21, 2024
1 parent 39c5b58 commit 8201a7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
optionIndex = $scope.genericRemoteOptions.map(function(option) {
return option.name;
}).indexOf(key);
$scope.genericRemoteOptions[optionIndex].value = remOptions[key].join($scope.genericRemoteOptions[optionIndex].delimiter);
if ($scope.genericRemoteOptions[optionIndex].delimiter) {
$scope.genericRemoteOptions[optionIndex].value = remOptions[key].join($scope.genericRemoteOptions[optionIndex].delimiter);
} else {
$scope.genericRemoteOptions[optionIndex].value = remOptions[key];
}
}
});
}
Expand Down
3 changes: 3 additions & 0 deletions lib/katello/repository_types/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
generic_remote_option :package_types, title: N_("Package Types"), type: Array, input_type: "text", delimiter: ",", default: [],
description: N_("Package types to sync for Python content, separated by comma. Leave empty to get every package type. Package types are: bdist_dmg, bdist_dumb, bdist_egg, bdist_msi, bdist_rpm, bdist_wheel, bdist_wininst, sdist.")

generic_remote_option :keep_latest_packages, title: N_("Keep latest packages"), type: :number, input_type: "number", default: 0,
description: N_("The amount of latest versions of a package to keep on sync, includes pre-releases if synced. Default 0 keeps all versions.")

url_description N_("URL of a PyPI content source such as https://pypi.org.")

generic_content_type 'python_package',
Expand Down

0 comments on commit 8201a7a

Please sign in to comment.