Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #35676 - Handle whitespace issue in Python package types #11298

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/controllers/katello/api/v2/repositories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ def create
repo_params[:ssl_client_cert] = ssl_client_cert
repo_params[:ssl_client_key] = ssl_client_key

if repo_params[:package_types]
repo_params[:package_types] = repo_params[:package_types].map(& :strip)
end

root = construct_repo_from_params(repo_params)
sync_task(::Actions::Katello::Repository::CreateRoot, root)
@repository = root.reload.library_instance
Expand Down Expand Up @@ -395,6 +399,10 @@ def update
fail "Do not include the username/password in the URL. Use the username/password settings instead."
end

if repo_params[:package_types]
repo_params[:package_types] = repo_params[:package_types].map(& :strip)
end

if @repository.generic?
generic_remote_options = generic_remote_options_hash(repo_params)
repo_params[:generic_remote_options] = generic_remote_options.to_json
Expand Down
2 changes: 1 addition & 1 deletion lib/katello/repository_types/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
description: N_("Python packages to exclude from the upstream URL, names separated by newline. You may also specify versions, for example: django~=2.0.")

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.")
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.")
Expand Down