Class: Y2Network::Autoinst::Config

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

Overview

This class is responsible of storing network settings that are only relevant to the autoinstallation proccess.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Config

Constructor

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :before_proposal (Boolean)
  • :start_immediately (Boolean)
  • :keep_install_network (Boolean)
  • :ip_check_timetout (Integer)
  • :virt_bridge_proposal (Boolean)

52
53
54
55
56
57
58
59
60
61
62
# File 'src/lib/y2network/autoinst/config.rb', line 52

def initialize(opts = {})
  ay_options = opts.reject { |_k, v| v.nil? }

  @before_proposal = ay_options.fetch(:before_proposal, false)
  @start_immediately = ay_options.fetch(:start_immediately, true)
  @keep_install_network = ay_options.fetch(:keep_install_network, true)
  @ip_check_timeout = ay_options.fetch(:ip_check_timeout, -1)
  @virt_bridge_proposal = ay_options.fetch(:virt_bridge_proposal, true)
  @managed              = ay_options[:managed]
  @backend              = ay_options[:backend]
end

Instance Attribute Details

#backendSymbol

Returns backend id.

Returns:

  • (Symbol)

    backend id


42
43
44
# File 'src/lib/y2network/autoinst/config.rb', line 42

def backend
  @backend
end

#before_proposalBoolean

Returns controls whether the network configuration should be run before the proposal.

Returns:

  • (Boolean)

    controls whether the network configuration should be run before the proposal


27
28
29
# File 'src/lib/y2network/autoinst/config.rb', line 27

def before_proposal
  @before_proposal
end

#ip_check_timeoutInteger

Returns:

  • (Integer)

35
36
37
# File 'src/lib/y2network/autoinst/config.rb', line 35

def ip_check_timeout
  @ip_check_timeout
end

#keep_install_networkBoolean

Returns controls whether the configuration done during the installation should be copied to the target system at the end.

Returns:

  • (Boolean)

    controls whether the configuration done during the installation should be copied to the target system at the end


33
34
35
# File 'src/lib/y2network/autoinst/config.rb', line 33

def keep_install_network
  @keep_install_network
end

#managedBoolean

Returns whether the network is managed by NM or not

Returns:

  • (Boolean)

    returns whether the network is managed by NM or not


40
41
42
# File 'src/lib/y2network/autoinst/config.rb', line 40

def managed
  @managed
end

#start_immediatelyBoolean

Returns controls whether the network should be restarted immediately after write or not.

Returns:

  • (Boolean)

    controls whether the network should be restarted immediately after write or not


30
31
32
# File 'src/lib/y2network/autoinst/config.rb', line 30

def start_immediately
  @start_immediately
end

#virt_bridge_proposalBoolean

Returns controls whether a bridge configuration for virtualization network should be proposed or not.

Returns:

  • (Boolean)

    controls whether a bridge configuration for virtualization network should be proposed or not


38
39
40
# File 'src/lib/y2network/autoinst/config.rb', line 38

def virt_bridge_proposal
  @virt_bridge_proposal
end

Instance Method Details

#copy_network?Boolean

Return whether the network should be copied at the end

Returns:

  • (Boolean)

67
68
69
# File 'src/lib/y2network/autoinst/config.rb', line 67

def copy_network?
  keep_install_network || before_proposal
end