Module: ForemanHyperv::HostManagedExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/foreman_hyperv/host_managed_extensions.rb

Instance Method Summary collapse

Instance Method Details

#setComputeUpdateObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/models/concerns/foreman_hyperv/host_managed_extensions.rb', line 13

def setComputeUpdate
  ret = super
  return ret unless provider == 'Hyper-V'

  begin
    hyperv_sync_interfaces
  rescue => e
    failure _("Failed to update a compute %{compute_resource} instance %{name}: %{e}") %
            { compute_resource:, name:, e: }, e
  end
  true
end

#update(attributes = {}) ⇒ Object



7
8
9
10
11
# File 'app/models/concerns/foreman_hyperv/host_managed_extensions.rb', line 7

def update(attributes = {})
  hyperv_add_attributes(attributes) if provider == 'Hyper-V' && attributes.key?('compute_attributes')

  super
end