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 10, 2017
1 parent 0d66776 commit 3ec67f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class << self
def networks(extra_attributes = {})
attributes = {
:model_class => ::Network,
:manager_ref => [:hardware, :ipaddress],
:manager_ref => [:hardware, :ipaddress, :ipv6address],
:association => :networks,
}

Expand Down

0 comments on commit 3ec67f4

Please sign in to comment.