Class: Y2Network::Autoinst::InterfacesReader
- Inherits:
-
Object
- Object
- Y2Network::Autoinst::InterfacesReader
- Includes:
- Yast::Logger
- Defined in:
- src/lib/y2network/autoinst/interfaces_reader.rb
Overview
This class is responsible of importing the AutoYast interfaces section
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#config ⇒ ConnectionConfigsCollection
Creates a new ConnectionConfigsCollection config from the imported profile interfaces section.
-
#initialize(section) ⇒ InterfacesReader
constructor
A new instance of InterfacesReader.
Constructor Details
#initialize(section) ⇒ InterfacesReader
Returns a new instance of InterfacesReader.
36 37 38 |
# File 'src/lib/y2network/autoinst/interfaces_reader.rb', line 36 def initialize(section) @section = section end |
Instance Attribute Details
#section ⇒ AutoinstProfile::InterfacesSection (readonly)
33 34 35 |
# File 'src/lib/y2network/autoinst/interfaces_reader.rb', line 33 def section @section end |
Instance Method Details
#config ⇒ ConnectionConfigsCollection
Note:
interfaces will be created automatic from connection configs
Creates a new ConnectionConfigsCollection config from the imported profile interfaces section
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'src/lib/y2network/autoinst/interfaces_reader.rb', line 45 def config configs = @section.interfaces.map do |interface_section| log.info "Creating config for interface section: #{interface_section.inspect}" config = create_config(interface_section) config.propose # propose reasonable defaults for not set attributes load_generic(config, interface_section) case config when ConnectionConfig::Vlan load_vlan(config, interface_section) when ConnectionConfig::Bridge load_bridge(config, interface_section) when ConnectionConfig::Bonding load_bonding(config, interface_section) when ConnectionConfig::Wireless load_wireless(config, interface_section) end log.info "Resulting config: #{config.inspect}" config end ConnectionConfigsCollection.new(configs) end |