Class: ForemanNetbox::SyncHost::SyncDevice::Update
- Inherits:
-
Object
- Object
- ForemanNetbox::SyncHost::SyncDevice::Update
- Includes:
- Concerns::AssignTags, Concerns::PrimaryIps, Interactor
- Defined in:
- app/interactors/foreman_netbox/sync_host/sync_device/update.rb
Constant Summary collapse
- ATTRIBUTES =
%i[name device_role device_type primary_ip4 primary_ip6 site tenant serial].freeze
Instance Method Summary collapse
Methods included from Concerns::AssignTags
#assign_tags_to, #default_tag_ids
Methods included from Concerns::PrimaryIps
#ip_addresses_map, #primary_ip4, #primary_ip6
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/interactors/foreman_netbox/sync_host/sync_device/update.rb', line 21 def call assign_new_attributes (device) device.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 |