Class: Y2Network::Autoinst::DNSReader

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

Overview

This class is responsible of importing the AutoYast dns section

Constant Summary collapse

DEFAULT_RESOLV_CONF_POLICY =
"auto".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(section) ⇒ DNSReader

Returns a new instance of DNSReader.

Parameters:



35
36
37
# File 'src/lib/y2network/autoinst/dns_reader.rb', line 35

def initialize(section)
  @section = section
end

Instance Attribute Details

#sectionAutoinstProfile::DNSSection (readonly)



30
31
32
# File 'src/lib/y2network/autoinst/dns_reader.rb', line 30

def section
  @section
end

Instance Method Details

#configDNS

Creates a new DNS config from the imported profile dns section

Returns:

  • (DNS)

    the imported DNS config



42
43
44
45
46
47
48
# File 'src/lib/y2network/autoinst/dns_reader.rb', line 42

def config
  Y2Network::DNS.new(
    nameservers:        valid_ips(section.nameservers),
    resolv_conf_policy: section.resolv_conf_policy || DEFAULT_RESOLV_CONF_POLICY,
    searchlist:         section.searchlist
  )
end