Class: Command::NodeDetach
- Inherits:
-
CrowbarNodeCommand
- Object
- BasicCommand
- CrowbarCommand
- CrowbarNodeCommand
- Command::NodeDetach
- Defined in:
- lib/command/node_detach.rb
Overview
Allows to detach a node
Instance Attribute Summary collapse
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
Attributes inherited from BasicCommand
Instance Method Summary collapse
-
#exec ⇒ Object
Method who call crowbar receiver in order to detach a node.
-
#initialize(node_name) ⇒ NodeDetach
constructor
Default constructor.
Constructor Details
#initialize(node_name) ⇒ NodeDetach
Default constructor
16 17 18 19 20 |
# File 'lib/command/node_detach.rb', line 16 def initialize(node_name) super() @logger.info("Command::NodeDetach initialize the parameters...") @node_name = node_name end |
Instance Attribute Details
#node_name ⇒ Object (readonly)
Returns the value of attribute node_name.
10 11 12 |
# File 'lib/command/node_detach.rb', line 10 def node_name @node_name end |
Instance Method Details
#exec ⇒ Object
Method who call crowbar receiver in order to detach a node
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/command/node_detach.rb', line 24 def exec() begin @receiver.(@node_name) rescue => e puts "Error: Delete the node '#{@node_name}' in all proposals : " + e. end begin @receiver.(@node_name) rescue => e puts "Error: Delete the node '#{@node_name}' of Crowbar : " + e. end begin @receiver.(@node_name) rescue => e puts "Error: Erase the node '#{@node_name}' in the server Crowbar : " + e. end end |