Skip to content

Commit

Permalink
Fix missing do_disconnect check in link_inventory
Browse files Browse the repository at this point in the history
Fixes an issue found by ManageIQ#16718
where relationships are deleted even though disconnect is false.
  • Loading branch information
agrare committed Jan 2, 2018
1 parent 14d1aa3 commit a97fa16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ems_refresh/link_inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def link_ems_inventory(ems, target, prev_relats, new_relats, disconnect = true)
update_relats(:resource_pools_to_vms, prev_relats, new_relats) do |r|
rp = instance_with_id(ResourcePool, r)
break if rp.nil?
[proc { |v| rp.remove_vm(instance_with_id(VmOrTemplate, v)) }, # Disconnect proc
[do_disconnect ? proc { |v| rp.remove_vm(instance_with_id(VmOrTemplate, v)) } : nil, # Disconnect proc
proc { |v| rp.add_vm(instance_with_id(VmOrTemplate, v)) }, # Connect proc
proc { |vs| rp.add_vm(instances_with_ids(VmOrTemplate, vs)) }] # Bulk connect proc
end
Expand Down

0 comments on commit a97fa16

Please sign in to comment.