Skip to content

Commit

Permalink
work in progress for idaholab#449, handle multiple netbox sites. uplo…
Browse files Browse the repository at this point in the history
…ad and logstash parts are mostly working
  • Loading branch information
mmguero committed Jun 11, 2024
1 parent 5117f29 commit 829d279
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logstash/ruby/netbox_enrich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ def netbox_lookup(
if _device_to_vm
# you can't "convert" a device to a VM, so we have to create a new VM then delete the old device
_vm_data = { :name => _patched_device_data.fetch(:name, [previous_result.fetch(:name, nil)])&.flatten&.uniq.first,
:site => ((_previous_device_site_obj = lookup_or_create_site(_previous_device_site, _nb)) &&
:site => ((_previous_device_site_obj = lookup_or_create_site(0, _previous_device_site, _nb)) &&
_previous_device_site_obj.is_a?(Hash) &&
_previous_device_site_obj.has_key?(:id)) ? _previous_device_site_obj[:id] : { :slug => _previous_device_site.to_url },
:tags => _tags,
Expand Down

0 comments on commit 829d279

Please sign in to comment.