Class: Y2Network::Autoinst::RoutingReader

Inherits:
Object
  • Object
show all
Defined in:
src/lib/y2network/autoinst/routing_reader.rb

Overview

This class is responsible of importing the AutoYast routing section

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(section) ⇒ RoutingReader

Returns a new instance of RoutingReader.

Parameters:



34
35
36
# File 'src/lib/y2network/autoinst/routing_reader.rb', line 34

def initialize(section)
  @section = section
end

Instance Attribute Details

#sectionAutoinstProfile::RoutingSection (readonly)



31
32
33
# File 'src/lib/y2network/autoinst/routing_reader.rb', line 31

def section
  @section
end

Instance Method Details

#configRouting

Creates a new Routing config from the imported profile routing section

Returns:



41
42
43
44
45
46
# File 'src/lib/y2network/autoinst/routing_reader.rb', line 41

def config
  tables = section.routes ? [Y2Network::RoutingTable.new(build_routes)] : []
  Y2Network::Routing.new(tables:       tables,
    forward_ipv4: !!section.ipv4_forward,
    forward_ipv6: !!section.ipv6_forward)
end