Class: Y2Network::Autoinst::DNSReader
- Inherits:
-
Object
- Object
- Y2Network::Autoinst::DNSReader
- 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
-
#config ⇒ DNS
Creates a new DNS config from the imported profile dns section.
-
#initialize(section) ⇒ DNSReader
constructor
A new instance of DNSReader.
Constructor Details
#initialize(section) ⇒ DNSReader
Returns a new instance of DNSReader.
36 37 38 |
# File 'src/lib/y2network/autoinst/dns_reader.rb', line 36 def initialize(section) @section = section end |
Instance Attribute Details
#section ⇒ AutoinstProfile::DNSSection (readonly)
31 32 33 |
# File 'src/lib/y2network/autoinst/dns_reader.rb', line 31 def section @section end |
Instance Method Details
#config ⇒ DNS
Creates a new DNS config from the imported profile dns section
43 44 45 46 47 48 49 50 51 |
# File 'src/lib/y2network/autoinst/dns_reader.rb', line 43 def config Y2Network::DNS.new( dhcp_hostname: section.dhcp_hostname, hostname: section.hostname || default_hostname, nameservers: valid_ips(section.nameservers), resolv_conf_policy: section.resolv_conf_policy || DEFAULT_RESOLV_CONF_POLICY, searchlist: section.searchlist ) end |