diff --git a/app/models/custom_button.rb b/app/models/custom_button.rb index 4e16abf5a19..195d664a0e6 100644 --- a/app/models/custom_button.rb +++ b/app/models/custom_button.rb @@ -94,7 +94,7 @@ def applies_to=(other) end def invoke(target, source = nil) - args = resource_action.automate_queue_hash(target, {}, User.current_user) + args = resource_action.automate_queue_hash(target, {"result_format" => 'ignore'}, User.current_user) publish_event(source, target, args) MiqQueue.put(queue_opts(target, args)) @@ -142,7 +142,7 @@ def invoke_async(target, source = nil) :userid => User.current_user } - args = resource_action.automate_queue_hash(target, {}, User.current_user) + args = resource_action.automate_queue_hash(target, {"result_format" => 'ignore'}, User.current_user) publish_event(source, target, args) MiqTask.generic_action_with_callback(task_opts, queue_opts(target, args)) diff --git a/app/models/resource_action.rb b/app/models/resource_action.rb index 28ab70c5223..dda288d8d8e 100644 --- a/app/models/resource_action.rb +++ b/app/models/resource_action.rb @@ -30,7 +30,6 @@ def automate_queue_hash(target, override_attrs, user, open_url_task_id = nil) end attrs = (ae_attributes || {}).merge(override_attrs || {}) - attrs["result_format"] = 'ignore' { :namespace => ae_namespace, diff --git a/spec/models/resource_action_spec.rb b/spec/models/resource_action_spec.rb index 986df22fc22..be8b9432198 100644 --- a/spec/models/resource_action_spec.rb +++ b/spec/models/resource_action_spec.rb @@ -4,7 +4,7 @@ let(:zone_name) { "default" } let(:ra) { FactoryBot.create(:resource_action) } let(:miq_server) { FactoryBot.create(:miq_server) } - let(:ae_attributes) { { "result_format" => "ignore"} } + let(:ae_attributes) { {} } let(:q_args) do { :namespace => nil, @@ -114,8 +114,12 @@ let(:user) { FactoryBot.create(:user_with_group) } let(:target) { FactoryBot.create(:vm_vmware) } - it "adds result_format" do - expect(ra.automate_queue_hash(target, {}, user)).to include(:attrs => {"result_format"=>"ignore"}) + it "passes result_format" do + expect(ra.automate_queue_hash(target, {"result_format"=>"ignore"}, user)).to include(:attrs => {"result_format"=>"ignore"}) + end + + it "does not pass result_format by default" do + expect(ra.automate_queue_hash(target, {}, user)).not_to include(:attrs => {"result_format"=>"ignore"}) end end end