Class: Command::NodeDestroy
- Inherits:
-
CrowbarNodeCommand
- Object
- BasicCommand
- CrowbarCommand
- CrowbarNodeCommand
- Command::NodeDestroy
- Defined in:
- lib/command/node_destroy.rb
Overview
Allows to destroy 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 destroy a node.
-
#initialize(node_name) ⇒ NodeDestroy
constructor
Default constructor.
Constructor Details
#initialize(node_name) ⇒ NodeDestroy
Default constructor
18 19 20 21 22 |
# File 'lib/command/node_destroy.rb', line 18 def initialize(node_name) super() @logger.info("Command::NodeDestroy initialize the parameters...") @node_name = node_name end |
Instance Attribute Details
#node_name ⇒ Object (readonly)
Returns the value of attribute node_name.
12 13 14 |
# File 'lib/command/node_destroy.rb', line 12 def node_name @node_name end |
Instance Method Details
#exec ⇒ Object
Method who call crowbar receiver in order to destroy a node
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/command/node_destroy.rb', line 26 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 hard disk into the node '#{@node_name}' : " + e. end begin @receiver.(@node_name) rescue => e puts "Error: Erase the node '#{@node_name}' in the server Crowbar : " + e. end begin @receiver.(node_name) rescue => e puts "Error: Reboot the node '#{@node_name}' : " + e. end end |