Class: OsCtld::DistConfig::Network::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
OsCtl::Lib::Utils::File, Helpers::Common
Defined in:
lib/osctld/dist_config/network/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Common

#systemd_service_enabled?, #systemd_service_masked?, #writable?

Constructor Details

#initialize(configurator) ⇒ Base

Returns a new instance of Base.

Parameters:



12
13
14
# File 'lib/osctld/dist_config/network/base.rb', line 12

def initialize(configurator)
  @configurator = configurator
end

Instance Attribute Details

#configuratorObject (readonly, protected)

Returns the value of attribute configurator.



45
46
47
# File 'lib/osctld/dist_config/network/base.rb', line 45

def configurator
  @configurator
end

Instance Method Details

#add_netif(netifs, netif) ⇒ Object

Called when a new network interface is added to a container

Parameters:



30
# File 'lib/osctld/dist_config/network/base.rb', line 30

def add_netif(netifs, netif); end

#configure(netifs) ⇒ Object

Parameters:

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/osctld/dist_config/network/base.rb', line 23

def configure(netifs)
  raise NotImplementedError
end

#remove_netif(netifs, netif) ⇒ Object

Called when a network interface is removed from a container

Parameters:



35
# File 'lib/osctld/dist_config/network/base.rb', line 35

def remove_netif(netifs, netif); end

#rename_netif(netifs, netif, old_name) ⇒ Object

Called when an existing network interface is renamed

Parameters:



41
# File 'lib/osctld/dist_config/network/base.rb', line 41

def rename_netif(netifs, netif, old_name); end

#usable?Boolean

Return true if this class can be used to configure the network

Returns:

  • (Boolean)


18
19
20
# File 'lib/osctld/dist_config/network/base.rb', line 18

def usable?
  false
end