Class: Y2Network::Sysconfig::InterfacesReader

Inherits:
Object
  • Object
show all
Defined in:
src/lib/y2network/sysconfig/interfaces_reader.rb

Overview

This class reads interfaces configuration from sysconfig files

  • Physical interfaces are read from the hardware.
  • Virtual interfaces + Connections are read from sysconfig.

Instance Method Summary collapse

Instance Method Details

#configHash<Symbol,Object>

Returns the interfaces and connections configuration


47
48
49
50
51
52
53
# File 'src/lib/y2network/sysconfig/interfaces_reader.rb', line 47

def config
  return @config if @config
  find_physical_interfaces
  find_connections
  find_drivers
  @config = { interfaces: @interfaces, connections: @connections, drivers: @drivers }
end

#connectionsArray<Y2Network::ConnectionConfig::Base>

Convenience method to get connections configuration


59
60
61
# File 'src/lib/y2network/sysconfig/interfaces_reader.rb', line 59

def connections
  config[:connections]
end

#driversArray<Y2Network::Driver>

Convenience method to get the drivers list


73
74
75
# File 'src/lib/y2network/sysconfig/interfaces_reader.rb', line 73

def drivers
  config[:drivers]
end

#interfacesY2Network::InterfacesCollection

Convenience method to get the interfaces list


66
67
68
# File 'src/lib/y2network/sysconfig/interfaces_reader.rb', line 66

def interfaces
  config[:interfaces]
end