Method: Command::NodeDestroy#exec

Defined in:
lib/command/node_destroy.rb

#execObject

Method who call crowbar receiver in order to destroy a node

Author:

  • mbretaud



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.crowbar_node_delete_proposal(@node_name)
  rescue => e
    puts "Error: Delete the node '#{@node_name}' in all proposals : " + e.message
  end

  begin
    @receiver.crowbar_node_delete(@node_name)
  rescue => e
    puts "Error: Delete the node '#{@node_name}' of Crowbar : " + e.message
  end

  begin
    @receiver.crowbar_erase_node_hard_disk(node_name)
  rescue => e
    puts "Error: Erase the hard disk into the node '#{@node_name}' : " + e.message
  end

  begin
    @receiver.crowbar_erase_node_server(@node_name)
  rescue => e
    puts "Error: Erase the node '#{@node_name}' in the server Crowbar : " + e.message
  end

  begin
    @receiver.crowbar_reboot_node(node_name)
  rescue => e
    puts "Error: Reboot the node '#{@node_name}' : " + e.message
  end
end