Class: Y2Network::Autoinst::UdevRulesReader
- Inherits:
-
Object
- Object
- Y2Network::Autoinst::UdevRulesReader
- Includes:
- Yast::Logger
- Defined in:
- src/lib/y2network/autoinst/udev_rules_reader.rb
Overview
This class is responsible of importing the AutoYast udev rules section It is a bit different than other readers as it does not produce its config, but instead it is applied on top of current config by applying proper names for interfaces or creating new ones.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#apply(config) ⇒ Object
Apply udev rules on passed config.
-
#initialize(section) ⇒ UdevRulesReader
constructor
A new instance of UdevRulesReader.
Constructor Details
#initialize(section) ⇒ UdevRulesReader
Returns a new instance of UdevRulesReader.
36 37 38 |
# File 'src/lib/y2network/autoinst/udev_rules_reader.rb', line 36 def initialize(section) @section = section end |
Instance Attribute Details
#section ⇒ AutoinstProfile::UdevRulesSection (readonly)
33 34 35 |
# File 'src/lib/y2network/autoinst/udev_rules_reader.rb', line 33 def section @section end |
Instance Method Details
#apply(config) ⇒ Object
Apply udev rules on passed config
42 43 44 45 46 47 48 49 50 51 |
# File 'src/lib/y2network/autoinst/udev_rules_reader.rb', line 42 def apply(config) @section.udev_rules.each do |udev_rule| target_interface = interface_for(config, udev_rule) if target_interface rename_interface(config, target_interface, udev_rule) else create_interface(config, udev_rule) end end end |