Skip to content

Commit

Permalink
for idaholab#415, work in progress on converting devices -> vms
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Apr 25, 2024
1 parent faabbcf commit 57c21bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logstash/ruby/netbox_enrich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ def netbox_lookup(
# it's actually a VM. However, a device can't have been autopopulated as a VM and then later
# "become" a device, since the only reason we'd have created it as a VM would be because
# we saw the OUI (from real traffic) in @vm_namesarray in the first place.
_is_vm = _was_vm || (_autopopulate_manuf.is_a?(Hash) && (_autopopulate_manuf.fetch(:vm, false) == true)
_is_vm = _was_vm || (_autopopulate_manuf.is_a?(Hash) && (_autopopulate_manuf.fetch(:vm, false) == true))
_device_to_vm = ((_was_vm == false) && (_is_vm == true))

if !_patched_device_data.empty? || _device_to_vm
Expand Down Expand Up @@ -1264,7 +1264,7 @@ def netbox_lookup(
# (yeah, this is a *little* inefficient, but this should really only happen one extra time per device at most)
_devices = lookup_devices(ip_key, @lookup_site, _lookup_service_port, @netbox_url_base, @netbox_url_suffix, _nb) if _device_written

end # check _patched_device_data
end # check _patched_device_data, _device_to_vm

end # check previous device ID is valid
end # check on previous_result function argument
Expand Down

0 comments on commit 57c21bc

Please sign in to comment.