Class: TestLab::Provisioner::Route
- Inherits:
-
Object
- Object
- TestLab::Provisioner::Route
- Includes:
- Utility::Misc
- Defined in:
- lib/testlab/provisioners/route.rb
Overview
Route Provisioner Class
Instance Method Summary collapse
-
#initialize(config = {}, ui = nil) ⇒ Route
constructor
A new instance of Route.
-
#on_network_down(network) ⇒ Object
(also: #on_network_destroy)
Route: Network Down.
-
#on_network_up(network) ⇒ Object
Route: Network Up.
-
#on_node_down(node) ⇒ Object
(also: #on_node_destroy)
Route: Node Down.
Methods included from Utility::Misc
#do_provisioner_callbacks, #format_message, #format_object_action, #please_wait, #sudo, #sudo_prompt
Constructor Details
#initialize(config = {}, ui = nil) ⇒ Route
Returns a new instance of Route.
14 15 16 17 18 19 20 21 |
# File 'lib/testlab/provisioners/route.rb', line 14 def initialize(config={}, ui=nil) @config = (config || Hash.new) @ui = (ui || TestLab.ui) @config[:route] ||= Hash.new @ui.logger.debug { "config(#{@config.inspect})" } end |
Instance Method Details
#on_network_down(network) ⇒ Object Also known as: on_network_destroy
Route: Network Down
31 32 33 34 35 |
# File 'lib/testlab/provisioners/route.rb', line 31 def on_network_down(network) manage_route(:del, network) true end |
#on_network_up(network) ⇒ Object
Route: Network Up
24 25 26 27 28 |
# File 'lib/testlab/provisioners/route.rb', line 24 def on_network_up(network) manage_route(:add, network) true end |
#on_node_down(node) ⇒ Object Also known as: on_node_destroy
Route: Node Down
39 40 41 42 43 44 45 |
# File 'lib/testlab/provisioners/route.rb', line 39 def on_node_down(node) node.networks.each do |network| manage_route(:del, network) end true end |