Skip to content

Commit

Permalink
Refs #29540 - Remove 3.16 deprecated functionality and warnings (Kate…
Browse files Browse the repository at this point in the history
…llo#8685)

* Refs #29540 - remove DOWNLOAD_BACKGROUND type

* Refs #29540 - remove hosts/:id/subscriptions/events endpoint

* Refs #29540 - remove ostree and puppet in repositories_controller

* Refs #29540 - update repositories_controller_test

* Refs #29540 - remove deprecation warning from create.rb and update.rb

* Refs #29540 - Fix root_repository tests

* Refs #29540 - fix some other tests

* Refs #29540 - Revert "remove DOWNLOAD_BACKGROUND type"

This reverts commit 120f8fa.

* Refs #29540 - Revert "remove ostree and puppet in repositories_controller"

This reverts commit 1afa706.

* Refs #29540 - Revert "update repositories_controller_test"

This reverts commit 9e65b13.

* Refs #29540 - Revert "remove deprecation warning from create.rb and update.rb"

This reverts commit f0441cd.

* Refs #29540 - Revert "Fix root_repository tests"

This reverts commit d7aa183.

* Refs #29540 - bump deprecation warnings for puppet and ostree

* Refs #29540 - add back erroneously removed test

* Refs #29540 - bump cp_dynflow deprecation warning

* Refs #29540 - remove route for events

* Refs #29540 - remove old 2.0 warnings
  • Loading branch information
jeremylenz authored and John Mitsch committed May 20, 2020
1 parent e2b3029 commit 664c059
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 20 deletions.
Expand Up @@ -67,7 +67,7 @@ def client_authorized?
end

def deprecated
::Foreman::Deprecation.api_deprecation_warning("it will be removed in Katello 3.15 - please use /consumers/:id/profiles instead.")
::Foreman::Deprecation.api_deprecation_warning("it will be removed in Katello 4.0. Please use /consumers/:id/profiles instead.")
end
end
end
Expand Up @@ -56,13 +56,6 @@ def auto_attach
respond_for_index(:collection => index_response, :template => "index")
end

api :GET, "/hosts/:host_id/subscriptions/events", N_("List subscription events for the host"), :deprecated => true
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
def events
::Foreman::Deprecation.api_deprecation_warning("Events API is being deprecated and will be removed in Katello 3.16.")
respond_for_index :collection => full_result_response([])
end

api :DELETE, "/hosts/:host_id/subscriptions/", N_("Unregister the host as a subscription consumer")
param :host_id, Integer, :desc => N_("Id of the host"), :required => true
def destroy
Expand Down
Expand Up @@ -99,7 +99,6 @@ def bulk_remove_host_collections
N_("Fetch applicable errata for one or more hosts.")
param_group :bulk_params
def applicable_errata
::Foreman::Deprecation.api_deprecation_warning("The 'applicable_hosts' field will be removed from this API in Katello 2.0")
respond_for_index(:collection => scoped_search(Katello::Erratum.applicable_to_hosts(@hosts), 'updated', 'desc',
:resource_class => Erratum))
end
Expand All @@ -108,7 +107,6 @@ def applicable_errata
N_("Fetch installable errata for one or more hosts.")
param_group :bulk_params
def installable_errata
::Foreman::Deprecation.api_deprecation_warning("The 'applicable_hosts' field will be removed from this API in Katello 2.0")
respond_for_index(:collection => scoped_search(Katello::Erratum.installable_for_hosts(@hosts), 'updated', 'desc',
:resource_class => Erratum))
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/katello/api/v2/repositories_controller.rb
Expand Up @@ -221,7 +221,7 @@ def create
end

if repo_params['content_type'] == "puppet" || repo_params['content_type'] == "ostree"
::Foreman::Deprecation.api_deprecation_warning("Puppet and OSTree will no longer be supported in Katello 3.16")
::Foreman::Deprecation.api_deprecation_warning("Puppet and OSTree will no longer be supported in Katello 4.0")
end

gpg_key = get_content_credential(repo_params, CONTENT_CREDENTIAL_GPG_KEY_TYPE)
Expand Down
4 changes: 2 additions & 2 deletions app/lib/actions/katello/repository/create.rb
Expand Up @@ -11,11 +11,11 @@ def plan(repository, clone = false, plan_create = false)
action_subject(repository)

if repository.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND
::Foreman::Deprecation.api_deprecation_warning("Background download_policy will be removed in Katello 3.16. Any background repositories will be converted to Immediate")
::Foreman::Deprecation.api_deprecation_warning("Background download_policy will be removed in Katello 4.0. Any background repositories will be converted to Immediate")
end

if root['content_type'] == 'puppet' || root['content_type'] == 'ostree'
::Foreman::Deprecation.api_deprecation_warning("Repository types of 'Puppet' and 'OSTree' will no longer be supported in Katello 3.16.")
::Foreman::Deprecation.api_deprecation_warning("Repository types of 'Puppet' and 'OSTree' will no longer be supported in Katello 4.0.")
end

org = repository.organization
Expand Down
4 changes: 2 additions & 2 deletions app/lib/actions/katello/repository/update.rb
Expand Up @@ -13,11 +13,11 @@ def plan(root, repo_params)
root.update!(repo_params)

if root.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND
::Foreman::Deprecation.api_deprecation_warning("Background download_policy will be removed in Katello 3.16. Any background repositories will be converted to Immediate")
::Foreman::Deprecation.api_deprecation_warning("Background download_policy will be removed in Katello 4.0. Any background repositories will be converted to Immediate")
end

if root['content_type'] == 'puppet' || root['content_type'] == 'ostree'
::Foreman::Deprecation.api_deprecation_warning("Repository types of 'Puppet' and 'OSTree' will no longer be supported in Katello 3.16.")
::Foreman::Deprecation.api_deprecation_warning("Repository types of 'Puppet' and 'OSTree' will no longer be supported in Katello 4.0.")
end

if update_content?(repository)
Expand Down
1 change: 0 additions & 1 deletion config/routes/overrides.rb
Expand Up @@ -105,7 +105,6 @@ def matches?(request)
collection do
put :auto_attach
get :product_content
get :events
get :available_release_versions
put :content_override
put :remove_subscriptions
Expand Down
Expand Up @@ -29,7 +29,7 @@ <h4 translate>Basic Information</h4>

<div class="alert alert-warning" ng-if="repository.content_type === 'ostree' || repository.content_type === 'puppet'">
<span class="pficon pficon-warning-triangle-o"></span>
<strong>Deprecation Warning: </strong>Puppet and OSTree will no longer be supported in Katello 3.16.
<strong>Deprecation Warning: </strong>Puppet and OSTree will no longer be supported in Katello 4.0.
</div>

<div class="divider"></div>
Expand Down
Expand Up @@ -41,7 +41,7 @@ <h4 translate> Basic Information </h4>

<div class="alert alert-warning" ng-if="repository.content_type === 'ostree' || repository.content_type === 'puppet'">
<span class="pficon pficon-warning-triangle-o"></span>
<strong>Deprecation Warning: </strong>Puppet and OSTree will no longer be supported in Katello 3.16.
<strong>Deprecation Warning: </strong>Puppet and OSTree will no longer be supported in Katello 4.0.
</div>

<div bst-form-group label="{{ 'Restrict to Architecture' | translate }}" ng-show="repository.content_type === 'yum'">
Expand Down Expand Up @@ -308,5 +308,3 @@ <h4 ng-show="repository.content_type !== undefined" translate> Published Reposit
</div>
</form>
</div>


0 comments on commit 664c059

Please sign in to comment.