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
|
# File 'lib/vagabond/actions/destroy.rb', line 26
def _destroy
name_required!
if(options[:cluster])
nodes = vagabondfile[:clusters][name] if vagabondfile[:clusters]
if(nodes)
ui.info "#{ui.color('Vagabond:', :bold)} Destroying cluster - #{ui.color(name, :red)}"
else
ui.error "Cluster name provided does not exist: #{name}"
nodes = []
end
else
nodes = [name, @leftover_args].flatten.compact
end
nodes.each do |n|
next unless n.is_a?(String)
@name = n
load_configurations
if(lxc.exists?)
ui.info "#{ui.color('Vagabond:', :bold)} Destroying node: #{ui.color(name, :red)}"
do_destroy
ui.info ui.color(' -> DESTROYED', :red)
else
ui.error "Node not created: #{name}"
end
end
end
|