Class: Y2Network::Autoinst::ConfigReader
- Inherits:
-
Object
- Object
- Y2Network::Autoinst::ConfigReader
- Defined in:
- src/lib/y2network/autoinst/config_reader.rb
Overview
This class is responsible of importing Autoyast configuration
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#config ⇒ Y2Network::Config
Network configuration.
-
#initialize(section, original_config) ⇒ ConfigReader
constructor
Constructor.
Constructor Details
#initialize(section, original_config) ⇒ ConfigReader
Constructor
43 44 45 46 |
# File 'src/lib/y2network/autoinst/config_reader.rb', line 43 def initialize(section, original_config) @section = section @original_config = original_config end |
Instance Attribute Details
#section ⇒ AutoinstProfile::NetworkingSection (readonly)
37 38 39 |
# File 'src/lib/y2network/autoinst/config_reader.rb', line 37 def section @section end |
Instance Method Details
#config ⇒ Y2Network::Config
Returns Network configuration.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'src/lib/y2network/autoinst/config_reader.rb', line 49 def config config = @original_config.copy # apply at first udev rules, so interfaces names are correct UdevRulesReader.new(section.udev_rules).apply(config) if section.udev_rules config.routing = RoutingReader.new(section.routing).config if section.routing config.dns = DNSReader.new(section.dns).config if section.dns if section.interfaces interfaces = InterfacesReader.new(section.interfaces).config interfaces.each do |interface| # add or update system configuration, this will also create all missing interfaces config.add_or_update_connection_config(interface) end end config end |