Created attachment 1616592 [details] simulation page Description of problem: If you put 'message' in 'attribute/value pairs' field then it does not consider while simulation. Version-Release number of selected component (if applicable): 5.11.0.25.20190913144023_5682444 How reproducible: 100% Steps to Reproduce: 1. Create domain, namespace, class and instance pointing to method 2. Navigate to automate > automation > simulation page 3. Fill values as shown in screenshot. 4. See automation.logs Actual results: [----] I, [2019-09-19T03:29:39.214008 #10804:41c3a00] INFO -- : Followed Relationship [miqaedb:/test_name/test_class/test_instance#create] [----] I, [2019-09-19T03:29:39.214742 #10804:41c3a00] INFO -- : Followed Relationship [miqaedb:/System/Request/Call_Instance#create] It does not consider attribute 'message' in logs with test_instance. Expected results: [----] I, [2019-09-19T03:29:39.214008 #10804:41c3a00] INFO -- : Followed Relationship [miqaedb:/test_name/test_class/test_instance#hello] [----] I, [2019-09-19T03:29:39.214742 #10804:41c3a00] INFO -- : Followed Relationship [miqaedb:/System/Request/Call_Instance#create] It should consider attribute message in logs with test_instance as per BZ fixed for custom button simulation: https://bugzilla.redhat.com/show_bug.cgi?id=1651099 Additional info: - This behaviour is same for simulation on 5.10 and 5.11. Hence not adding it as a regression.
Created attachment 1616596 [details] simulation page
Hi Ganesh, From simulate, you'll need to specify the call_instance_with_message instance as described here: https://bugzilla.redhat.com/show_bug.cgi?id=1672693 Please let me know if you have any questions. Thanks, Tina
Hi Tina, As per this comment https://bugzilla.redhat.com/show_bug.cgi?id=1672693#c6 >> Simulate does not have the message specified(or has create as the message) >> [----] I, [2019-02-18T04:51:47.631004 #10135:fc295c] INFO -- : Followed Relationship [miqaedb:/System/custom_request/instance_1#create] >> [----] I, [2019-02-18T04:51:47.631902 #10135:fc295c] INFO -- : Followed Relationship [miqaedb:/System/Request>> >>/Call_Instance_With_Message#create] I can see that 'message' attribute was not added while simulation. So that I shows #create message. But in my case, I have added 'message' attribute and expecting this message with instance. as described above. As you said, I tried with "call_instance_with_message" but I am still able to reproduce this issue: [----] I, [2019-09-19T11:44:10.309890 #7834:2ad9700d06b4] INFO -- : <AEMethod test_meth> hello [----] I, [2019-09-19T11:44:10.333773 #7834:2ad969a8a2ec] INFO -- : <AEMethod [/test_domain/test_name/test_class/test_meth]> Ending [----] I, [2019-09-19T11:44:10.333909 #7834:2ad969a8a2ec] INFO -- : Method exited with rc=MIQ_OK [----] I, [2019-09-19T11:44:10.334371 #7834:2ad969a8a2ec] INFO -- : Followed Relationship [miqaedb:/test_name/test_class/test_instance#create] [----] I, [2019-09-19T11:44:10.335290 #7834:2ad969a8a2ec] INFO -- : Followed Relationship [miqaedb:/System/Request/call_instance_with_message#create] Please let me know if something is missing. Thanks, Ganesh
in def build_results inside the ui/app/controllers/application_controller/automate.rb 144: ws = MiqAeEngine.resolve_automation_object(@sb[:name], 145: User.current_user, 146: automation_attrs, 147: options, 148: @resolve[:new][:readonly]) 149: ws.root['ae_result'] ||= 'ok' 150: @results = ws.to_expanded_xml 151: @resolve[:uri] = options[:uri] 152: @resolve[:ae_result] = ws.root['ae_result'] 153: @resolve[:state_attributes] = ws.root['ae_result'] == 'retry' ? state_attributes(ws) : {} 154: @ae_simulation_tree = TreeBuilderAutomateSimulationResults.new(:ae_simulation_tree, @sb, true, :root => @results) 155: end [1] pry(#<MiqAeToolsController>)> automation_attrs["message"] => "create" [2] pry(#<MiqAeToolsController>)> automation_attrs => {"namespace"=>"system", "class"=>"request", "instance"=>"inspectme", "message"=>"create", "request"=>"call_instance_with_message"} [3] pry(#<MiqAeToolsController>)> options => {:vmdb_object=>nil, :fqclass=>"SYSTEM/PROCESS"} [4] pry(#<MiqAeToolsController>)> @sb => {"perf_options"=> #<struct ApplicationController::Performance::Options ... "name"=>"Request", "attrs"=>{"namespace"=>"system", "class"=>"request", "instance"=>"inspectme", "message"=>"drewwww", "request"=>"call_instance_with_message"}, "obj"=>nil} @sb["attrs"]["message"] has the simulate attribute, and automation_attrs["message"] has the other message. However, we next call ws = MiqAeEngine.resolve_automation_object(@sb[:name], User.current_user, automation_attrs, options, @resolve[:new][:readonly]) and only have the automation_attrs so the simulate attribute gets dropped.
Hi Patrik, Let me know if you have any questions, and/or if you would like to get together to discuss this issue. Thanks, Tina
A Github Issue has been opened to track the resolution of the reported defect. Moving to a Github Issue provides access to the larger ManageIQ community for assistance in resolving this defect. Please refer to https://github.com/ManageIQ/manageiq-automation_engine/issues/469 for future updates regarding this issue. If you have any concerns about this, please let us know. Thanks and regards!