Class: Y2Network::Wicked::ConnectionConfigReader

Inherits:
Object
  • Object
show all
Includes:
Yast::Logger
Defined in:
src/lib/y2network/wicked/connection_config_reader.rb

Overview

Reads a connection configuration for a given interface

Instance Method Summary collapse

Instance Method Details

#read(name, type, issues_list) ⇒ Y2Network::ConnectionConfig::Base

Constructor

Parameters:

  • name (String)

    Interface name

  • type (InterfaceType, string, nil)

    Interface type; if the type is unknown, nil can be used and it will be guessed from the configuration file if possible.

Returns:



36
37
38
39
40
41
42
43
# File 'src/lib/y2network/wicked/connection_config_reader.rb', line 36

def read(name, type, issues_list)
  file = CFA::InterfaceFile.new(name)
  file.load
  handler_class = find_handler_class(type || file.type)
  return nil if handler_class.nil?

  handler_class.new(file, issues_list).connection_config
end