Class: ForemanNetbox::SyncHost::SyncDevice::Find

Inherits:
Object
  • Object
show all
Includes:
Interactor
Defined in:
app/interactors/foreman_netbox/sync_host/sync_device/find.rb

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
14
# File 'app/interactors/foreman_netbox/sync_host/sync_device/find.rb', line 9

def call
  context.device = find_by_serial || find_by_mac || find_by_name
rescue NetboxClientRuby::LocalError, NetboxClientRuby::ClientError, NetboxClientRuby::RemoteError => e
  ::Foreman::Logging.logger('foreman_netbox/import').error("#{self.class} error #{e}: #{e.backtrace}")
  context.fail!(error: "#{self.class}: #{e}")
end