Skip to content

Commit

Permalink
Fixes #36083 - Remove remote_execution_by_default setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz authored and parthaa committed Aug 17, 2023
1 parent 05b73f7 commit 283c63d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ def incremental_update
validate_content(params[:add_content])
resolve_dependencies = params.fetch(:resolve_dependencies, true)
task = async_task(::Actions::Katello::ContentView::IncrementalUpdates, @content_view_version_environments, @composite_version_environments,
params[:add_content], resolve_dependencies, hosts, params[:description],
Setting[:remote_execution_by_default] && ::Katello.with_remote_execution?)
params[:add_content], resolve_dependencies, hosts, params[:description])
respond_for_async :resource => task
end

Expand Down
4 changes: 2 additions & 2 deletions app/lib/actions/katello/content_view/incremental_updates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module ContentView
class IncrementalUpdates < Actions::EntryAction
include Helpers::Presenter

def plan(version_environments, composite_version_environments, content, dep_solve, hosts, description,
use_remote_execution = false)
def plan(version_environments, composite_version_environments, content, dep_solve, hosts, description) # rubocop:disable Metrics/MethodLength
use_remote_execution = true # TODO: remove this when we remove katello-agent dynflow actions
old_new_version_map = {}
output_for_version_ids = []

Expand Down
4 changes: 0 additions & 4 deletions app/views/katello/api/v2/content_facet/show.json.rabl
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ child :content_facet => :content_facet_attributes do
Katello.with_katello_agent?
end

node :remote_execution_by_default do
Katello.remote_execution_by_default?
end

user = User.current # current_user is not available here
child :permissions do
node(:view_lifecycle_environments) { user.can?("view_lifecycle_environments") }
Expand Down
3 changes: 1 addition & 2 deletions engines/bastion_katello/lib/bastion_katello/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class Engine < ::Rails::Engine
'defaultDownloadPolicy' => !Foreman.in_rake? && db_migrated && Setting['default_download_policy'],
'katelloAgentPresent' => ::Katello.with_katello_agent?,
'remoteExecutionPresent' => ::Katello.with_remote_execution?,
'hostToolingEnabled' => (::Katello.with_katello_agent? || ::Katello.with_remote_execution?) ? true : false,
'remoteExecutionByDefault' => ::Katello.remote_execution_by_default?
'hostToolingEnabled' => (::Katello.with_katello_agent? || ::Katello.with_remote_execution?) ? true : false
}
end
)
Expand Down
4 changes: 0 additions & 4 deletions lib/katello/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ def self.with_katello_agent?
!!SETTINGS.dig(:katello, :agent, :enabled)
end

def self.remote_execution_by_default?
self.with_katello_agent? ? Setting['remote_execution_by_default'] : true
end

def self.with_ansible?
Foreman::Plugin.installed?("foreman_ansible")
end
Expand Down
6 changes: 0 additions & 6 deletions lib/katello/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,6 @@ def katello_template_setting_values(name)
full_name: N_('Sync Sock Read Timeout'),
description: N_("The maximum number of seconds that Pulp can take to download a file, not counting connection time.")

setting 'remote_execution_by_default',
type: :boolean,
default: false,
full_name: N_('Use remote execution by default'),
description: N_("If this is enabled, remote execution is used instead of katello-agent for remote actions")

setting 'unregister_delete_host',
type: :boolean,
default: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_incremental_update
errata_id = Katello::Erratum.first.pulp_id
@controller.expects(:async_task).with(::Actions::Katello::ContentView::IncrementalUpdates,
[{:content_view_version => version, :environments => [@beta]}], [],
{'errata_ids' => [errata_id]}, true, [], nil, false).returns({})
{'errata_ids' => [errata_id]}, true, [], nil).returns({})

put :incremental_update, params: { :content_view_version_environments => [{:content_view_version_id => version.id, :environment_ids => [@beta.id]}], :add_content => {:errata_ids => [errata_id]}, :resolve_dependencies => true }

Expand All @@ -276,7 +276,7 @@ def test_incremental_update_with_deb
deb_id = Katello::Deb.first.id
@controller.expects(:async_task).with(::Actions::Katello::ContentView::IncrementalUpdates,
[{:content_view_version => version, :environments => [@beta]}], [],
{'errata_ids' => [errata_id], 'deb_ids' => [deb_id]}, true, [], nil, false).returns({})
{'errata_ids' => [errata_id], 'deb_ids' => [deb_id]}, true, [], nil).returns({})

put :incremental_update, params: { :content_view_version_environments => [{:content_view_version_id => version.id, :environment_ids => [@beta.id]}], :add_content => {:errata_ids => [errata_id], :deb_ids => [deb_id]}, :resolve_dependencies => true }

Expand All @@ -288,7 +288,7 @@ def test_incremental_update_without_env
errata_id = Katello::Erratum.first.pulp_id
@controller.expects(:async_task).with(::Actions::Katello::ContentView::IncrementalUpdates,
[{:content_view_version => version, :environments => []}], [],
{'errata_ids' => [errata_id]}, true, [], nil, false).returns({})
{'errata_ids' => [errata_id]}, true, [], nil).returns({})

put :incremental_update, params: { :content_view_version_environments => [{:content_view_version_id => version.id, :environment_ids => []}], :update_hosts => {:included => {:search => ''}}, :add_content => {:errata_ids => [errata_id]}, :resolve_dependencies => true }

Expand Down

0 comments on commit 283c63d

Please sign in to comment.