Class: Pec::Command::Destroy

Inherits:
Base
  • Object
show all
Defined in:
lib/pec/command/destroy.rb

Class Method Summary collapse

Methods inherited from Base

after_do, before_do, not_fetch, print_exception, run

Class Method Details

.task(server, config) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/pec/command/destroy.rb', line 3

def self.task(server, config)
  unless server
    Pec::Logger.notice "not be created #{config.name}"
  else
    if Pec.options[:force] || Thor.new.yes?("#{config.name}: Are you sure you want to destroy the '#{config.name}' VM? [y/N]")
      Yao::Server.destroy(server.id)
      Pec::Logger.info "#{config.name} is deleted!"
    end
  end
end