Class: Nic::Managed

Inherits:
Interface show all
Includes:
Orchestration, Orchestration::DHCP, Orchestration::DNS
Defined in:
app/models/nic/managed.rb

Direct Known Subclasses

BMC, Bootable

Instance Method Summary collapse

Methods included from Orchestration::DNS

included

Methods included from Orchestration::DHCP

included

Methods included from Orchestration

included

Methods included from Foreman::STI

included, #save_with_type

Instance Method Details

#dhcp_recordObject

returns a DHCP reservation object


34
35
36
37
# File 'app/models/nic/managed.rb', line 34

def dhcp_record
  return unless dhcp? or @dhcp_record
  @dhcp_record ||= Net::DHCP::Record.new(dhcp_attrs)
end

#queue_with_hostObject

this ensures we can create an interface even when there is no host queue e.g. outside to Host nested attributes


22
23
24
25
26
27
28
29
30
# File 'app/models/nic/managed.rb', line 22

def queue_with_host
  if host
    logger.debug 'Using host queue'
    host.queue
  else
    logger.debug 'Using nic queue'
    queue_without_host
  end
end