Class: Y2Network::AutoinstProfile::S390DevicesSection

Inherits:
SectionWithAttributes show all
Includes:
Yast::Logger
Defined in:
src/lib/y2network/autoinst_profile/s390_devices_section.rb

Overview

This class represents an AutoYaST <s390-devices> section under <networking>

<s390-devices config:type="list">
  <device>
    <chanids>0.0.0700 0.0.0701 0.0.0702</chanids>
    <type>qeth</type>
  </device>
</s390-devices>

See Also:

Constant Summary collapse

SUPPORTED_TYPES =
["qeth", "ctc", "lcs"].freeze

Instance Attribute Summary collapse

Attributes inherited from SectionWithAttributes

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SectionWithAttributes

new_from_hashes, #section_name, #to_hashes

Constructor Details

#initialize(*_args) ⇒ S390DevicesSection

Constructor


63
64
65
66
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 63

def initialize(*_args)
  super
  @devices = []
end

Instance Attribute Details

#devicesArray<S390DeviceSection>

Returns:


# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 48

Class Method Details

.attributesObject


40
41
42
43
44
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 40

def self.attributes
  [
    { name: :devices }
  ]
end

.new_from_network(config) ⇒ S390DevicesSection

Clones network s390 devices settings into an AutoYaST s390-devices section

Parameters:

  • config (Y2Network::Config)

    whole config as it need both s390-devices and connection configs

Returns:


56
57
58
59
60
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 56

def self.new_from_network(config)
  result = new
  initialized = result.init_from_network(config)
  initialized ? result : nil
end

Instance Method Details

#init_from_hashes(hash) ⇒ Object

Method used by Y2Network::AutoinstProfile::SectionWithAttributes.new_from_hashes to populate the attributes when importing a profile

Parameters:


71
72
73
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 71

def init_from_hashes(hash)
  @devices = devices_from_hash(hash)
end

#init_from_network(connection_configs) ⇒ Boolean

Method used by new_from_network to populate the attributes when cloning routing settings

Parameters:

Returns:

  • (Boolean)

    Result true on success or false otherwise


79
80
81
82
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 79

def init_from_network(connection_configs)
  @devices = s390_devices_section(connection_configs)
  true
end