From PR: https://github.com/ManageIQ/manageiq/pull/11811 Generic Object relationships are defined and implemented for AR objects. Generic Object methods are defined as for AR objects and implemented in automate model. Converting the object into AR model object when calling the generic object methods from automate as these methods are defined as AR model methods. Converting the object into service model object when returning the generic object method results back to automate. ManageIQ issue: https://github.com/ManageIQ/manageiq/issues/11728 The following script fails to add the service to the services relationship for a generic object. go_class = $evm.vmdb(:generic_object_definition).find_by(:name => "LoadBalancer") load_balancer = go_class.create_object(:name => "Test Load Balancer") service = $evm.vmdb(:service).first load_balancer.services = [service]
Created attachment 1245071 [details] Test domain Use the attached domain to test this bug: 1) Import end enable the domain 2) Have at least one service created (Generic is enough) 3) Run rails console and create the object definition: GenericObjectDefinition.create( :name => "LoadBalancer", :properties => { :attributes => {:location => "string"}, :associations => {:vms => "Vm", :services => "Service"}, } ) 4) Run tail -fn0 log/automation.log | egrep 'ERROR|XYZ' 5) Simulate Request/GOTest with method execution In the tail'ed log: There should be no ERROR lines related to the execution. There should be these two lines: <AEMethod gotest> XYZ go object: #<MiqAeServiceGenericObject ....something...> <AEMethod gotest> XYZ load balancer got service: #<MiqAeServiceService:....something....> If there is "XYZ load balancer got service: nil", then this bug was reproduced. thx @lfu
Verified in 5.8.0.3 using the steps in comment 3