Class: ForemanNetbox::SyncHost::SyncDevice::SyncDeviceRole::Create

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

Instance Method Summary collapse

Instance Method Details

#callObject



14
15
16
17
18
19
# File 'app/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/create.rb', line 14

def call
  context.device_role = ForemanNetbox::API.client::DCIM::DeviceRole.new(params).save
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