Class: Y2Network::AutoinstProfile::S390DeviceSection

Inherits:
SectionWithAttributes show all
Defined in:
src/lib/y2network/autoinst_profile/s390_device_section.rb

Overview

This class represents an AutoYaST section under

0.0.0700 0.0.0701 0.0.0702

See Also:

Constant Summary

Constants inherited from SectionWithAttributes

Y2Network::AutoinstProfile::SectionWithAttributes::VALUES_TO_SKIP

Instance Attribute Summary collapse

Attributes inherited from SectionWithAttributes

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SectionWithAttributes

#attribute_key, #attribute_name, #attribute_scalar, #attribute_skip?, #attribute_value, #attributes, define_attr_accessors, #init_from_hashes, #init_scalars_from_hash, #initialize, new_from_hashes, #section_name, #to_hashes

Constructor Details

This class inherits a constructor from Y2Network::AutoinstProfile::SectionWithAttributes

Instance Attribute Details

#chanidsString


# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 46

#layer2Boolean


# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 49

#portnameString


# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 55

#protocolString


# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 58

#routerString


# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 61

#typeString


# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 52

Class Method Details

.attributesObject


33
34
35
36
37
38
39
40
41
42
# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 33

def self.attributes
  [
    { name: :chanids },
    { name: :layer2 },
    { name: :type },
    { name: :portname }, # deprecated
    { name: :protocol },
    { name: :router }
  ]
end

.new_from_network(connection_config) ⇒ S390DeviceSection

Clones a network s390 connection config into an AutoYaST s390 device section


68
69
70
71
72
# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 68

def self.new_from_network(connection_config)
  result = new
  result.init_from_config(connection_config)
  result
end

Instance Method Details

#init_from_config(config) ⇒ Boolean

Method used by new_from_network to populate the attributes when cloning a network s390 device


79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 79

def init_from_config(config)
  @type = config.type.short_name
  case config
  when ConnectionConfig::Qeth
    @chanids = config.device_id
    @layer2 = config.layer2
  when ConnectionConfig::Ctc
    @chanids = config.device_id
    @protocol = config.protocol
  when ConnectionConfig::Lcs
    @chanids = config.device_id
  end

  true
end