Class: Y2Network::S390DeviceActivators::Qeth

Inherits:
Y2Network::S390DeviceActivator show all
Defined in:
src/lib/y2network/s390_device_activators/qeth.rb

Overview

This class is responsible of activating OSA-Express (QDIO) and HiperSockets group devices (qeth driver).

Constant Summary

Constants inherited from Y2Network::S390DeviceActivator

Y2Network::S390DeviceActivator::CONFIGURE_CMD, Y2Network::S390DeviceActivator::LIST_CMD

Instance Attribute Summary

Attributes inherited from Y2Network::S390DeviceActivator

#builder

Instance Method Summary collapse

Methods inherited from Y2Network::S390DeviceActivator

#configure, #configured_interface, #device_id, #device_id_from, for, #initialize

Constructor Details

This class inherits a constructor from Y2Network::S390DeviceActivator

Instance Method Details

#configure_attributesObject

Return a list of the options to be set when activating the device. The list is composed by the attributes configured and the attributes that have their own variable (layer2, port_number and ipa_takeover).

Examples:

Qeth configuration

activator.layer2 #=> true
activator.port_number #=> 1
activator.ipa_takeover #=> true
activator.attributes #=> "bridge_role=secondary"
activator.configure_attributes #=> ["bridge_role=secondary",
  "ipa_takeover/enable=1", "layer2=1", "portno=1"]

See Also:

  • Y2Network::S390DeviceActivators::Qeth.[S390DeviceActivator[S390DeviceActivator#configure_attributes]

47
48
49
50
51
52
53
54
55
56
# File 'src/lib/y2network/s390_device_activators/qeth.rb', line 47

def configure_attributes
  extra_attributes = []
  extra_attributes.concat(attributes.split(" ")) if attributes
  # Only set if enable
  extra_attributes << ipa_takeover_attribute if ipa_takeover
  # Only set if enable
  extra_attributes << layer2_attribute if layer2
  extra_attributes << port_attribute if port_number.to_s != "0"
  extra_attributes
end

#propose!Object


65
66
67
# File 'src/lib/y2network/s390_device_activators/qeth.rb', line 65

def propose!
  propose_channels unless device_id
end

#propose_channelsObject

Modifies the read, write and data channel from the the device id


59
60
61
62
63
# File 'src/lib/y2network/s390_device_activators/qeth.rb', line 59

def propose_channels
  id = device_id_from(hwinfo.busid)
  return unless id
  self.read_channel, self.write_channel, self.data_channel = id.split(":")
end