Skip to content

Commit

Permalink
Changing the key of network device to be both ipv4 + ipv6
Browse files Browse the repository at this point in the history
A network device may not have ipv4 addresses at all, using ipv4 as the sole
key is not enough.
  • Loading branch information
AlonaKaplan committed Dec 7, 2017
1 parent 0d66776 commit c684661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ems_refresh/save_inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def save_networks_inventory(hardware, hashes, mode = :refresh)
saved_hashes, new_hashes = hashes.partition { |h| h[:id] }
saved_hashes.each { |h| deletes.delete_if { |d| d.id == h[:id] } } unless deletes.empty? || saved_hashes.empty?

save_inventory_multi(hardware.networks, new_hashes, deletes, [:ipaddress], nil, :guest_device)
save_inventory_multi(hardware.networks, new_hashes, deletes, [:ipaddress, :ipv6address], nil, :guest_device)
when :scan
save_inventory_multi(hardware.networks, hashes, :use_association, [:description, :guid])
end
Expand Down

0 comments on commit c684661

Please sign in to comment.