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 <device> section under <s390-devices>

<device>
  <chanids>0.0.0700 0.0.0701 0.0.0702</chanids>
  <layer2 config:type="boolean>true</layer2>
  <type>qeth</type>
</device>

See Also:

Instance Attribute Summary collapse

Attributes inherited from SectionWithAttributes

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SectionWithAttributes

#init_from_hashes, #initialize, new_from_hashes, #section_name, #to_hashes

Constructor Details

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

Instance Attribute Details

#chanidsString

Returns channel device id separated by spaces.

Returns:

  • (String)

    channel device id separated by spaces


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

#layer2Boolean

Returns Whether layer2 is enabler or not.

Returns:

  • (Boolean)

    Whether layer2 is enabler or not


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

#portnameString

Returns QETH portname (deprecated).

Returns:

  • (String)

    QETH portname (deprecated)


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

#protocolString

Returns:

  • (String)

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

#routerString

Returns IUCV router/user.

Returns:

  • (String)

    IUCV router/user


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

#typeString

Returns S390 device type (qeth, ctc, iucv).

Returns:

  • (String)

    S390 device type (qeth, ctc, iucv)


# 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

Parameters:

Returns:


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

Parameters:

Returns:

  • (Boolean)

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