Class: Y2Network::Autoinst::HostnameReader

Inherits:
Object
  • Object
show all
Defined in:
src/lib/y2network/autoinst/hostname_reader.rb

Overview

This class is responsible of importing hostname setup from the AutoYast dns section

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(section) ⇒ HostnameReader

NOTE: for historical reasons DNS section contains even hostname

Parameters:



33
34
35
# File 'src/lib/y2network/autoinst/hostname_reader.rb', line 33

def initialize(section)
  @section = section
end

Instance Attribute Details

#sectionAutoinstProfile::DNSSection (readonly)



29
30
31
# File 'src/lib/y2network/autoinst/hostname_reader.rb', line 29

def section
  @section
end

Instance Method Details

#configHostname

Creates a new Hostname config from the imported profile dns section

Returns:



40
41
42
43
44
45
46
# File 'src/lib/y2network/autoinst/hostname_reader.rb', line 40

def config
  Y2Network::Hostname.new(
    dhcp_hostname: dhcp_hostname_for(section.dhcp_hostname),
    static:        section.hostname || static_hostname,
    installer:     section.hostname
  )
end