Class: Y2Network::Autoinst::S390DevicesReader

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

Overview

This class is responsible of importing the AutoYast S390 devices section

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(section) ⇒ S390DevicesReader


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

def initialize(section)
  @section = section
end

Instance Attribute Details

#sectionAutoinstProfile::S390DevicesSection (readonly)


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

def section
  @section
end

Instance Method Details

#configConnectionConfigsCollection


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'src/lib/y2network/autoinst/s390_devices_reader.rb', line 38

def config
  connections = ConnectionConfigsCollection.new([])

  @section.devices.each do |device_section|
    config = create_config(device_section)
    next unless config

    case config
    when ConnectionConfig::Qeth
      load_qeth(config, device_section)
    when ConnectionConfig::Lcs
      load_lcs(config, device_section)
    when ConnectionConfig::Ctc
      load_ctc(config, device_section)
    end
    connections << config
  end

  connections
end