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 #21951 - don't allow export of on-demand repos #7338
Conversation
Issues: #21951 |
[test katello] |
Addressed the feedback I got this morning. Individual repositories are handled, and error message now includes the names of which repos are on-demand:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this and the code works wonderfully. The error message is much more helpful now. Happy to ACK once minor nitpicks are addressed 👍
@@ -250,6 +250,8 @@ def export | |||
|
|||
fail HttpErrors::BadRequest, _("Repository content type must be 'yum' to export.") unless @repository.content_type == 'yum' | |||
|
|||
fail HttpErrors::BadRequest, _("On-demand repositories cannot be exported.") if @repository.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Since hammer/UI refer to this as on demand
, can we remove the hyphen?
@@ -82,6 +82,10 @@ def export | |||
fail HttpErrors::BadRequest, _("ISO export must be enabled when specifying ISO size") | |||
end | |||
|
|||
if (repos = @version.content_view.on_demand_repositories).any? | |||
fail HttpErrors::BadRequest, _("This content view has on-demand repositories that cannot be exported: %{repos}" % {repos: repos.pluck(:label).join(", ")}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Since hammer/UI refer to this as on demand
, can we remove the hyphen?
@cfouant Thanks for the review! Good call for on demand, didn't notice the hyphen. Updated |
ACK thanks @stbenjam ! |
Thanks @cfouant ! |
Prevents exporting content views with on demand repositories: