Class: Y2Network::AutoinstProfile::S390DeviceSection

Inherits:
Installation::AutoinstProfile::SectionWithAttributes
  • Object
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:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#chanidsString

Returns channel device id separated by spaces or colons.

Returns:

  • (String)

    channel device id separated by spaces or colons



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

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

Parameters:

  • connection_config (Y2Network::ConnectionConfig)

    Network connection config

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

    Parent section

Returns:



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

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

Instance Method Details

#collection_nameString

Returns the collection name

Returns:

  • (String)

    "devices"



107
108
109
# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 107

def collection_name
  "devices"
end

#init_from_config(config) ⇒ Boolean

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

Parameters:

Returns:

  • (Boolean)


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

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

#init_from_hashes(hash) ⇒ Object

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

Parameters:

  • hash (Hash)

    see new_from_hashes



99
100
101
102
# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 99

def init_from_hashes(hash)
  super
  self.chanids = normalized_chanids(hash["chanids"]) if hash["chanids"]
end

#section_pathInstallation::AutoinstProfile::ElementPath?

Returns the section path

Returns:

  • (Installation::AutoinstProfile::ElementPath, nil)

    Section path or nil if the parent is not set



115
116
117
118
119
# File 'src/lib/y2network/autoinst_profile/s390_device_section.rb', line 115

def section_path
  return nil unless parent

  parent.section_path.join(index)
end