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

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

Instance Method Summary collapse

Instance Method Details

#callObject



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

def call
  context.site = ForemanNetbox::API.client.dcim.sites.find_by(params)
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