Class: Y2Network::AutoinstProfile::S390DevicesSection

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

Overview

This class represents an AutoYaST section under

0.0.0700 0.0.0701 0.0.0702 qeth

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*_args) ⇒ S390DevicesSection

Constructor



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

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, parent = nil) ⇒ 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

  • parent (SectionWithAttributes, nil) (defaults to: nil)

    Parent section

Returns:



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

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

Instance Method Details

#init_from_hashes(hash) ⇒ Object

Method used by new_from_hashes to populate the attributes when importing a profile

Parameters:

  • hash (Array)

    see new_from_hashes. In this case it is array of devices



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

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



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

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

#section_nameString

Returns the collection name

Returns:

  • (String)

    "s390-devices"



88
89
90
# File 'src/lib/y2network/autoinst_profile/s390_devices_section.rb', line 88

def section_name
  "s390-devices"
end