Class: Pec::Command::Halt
Class Method Summary collapse
Methods inherited from Base
before_do, print_exception, run
Class Method Details
.task(host_name, options, server, config) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/pec/command/halt.rb', line 4 def self.task(host_name, , server, config) case when server.nil? Pec::Logger.notice "not be created #{config.name}" when server.status != "ACTIVE" Pec::Logger.notice "#{config.name} server status is #{server.status} must be ACTIVE" else Yao::Server.shutoff(server.id) Pec::Logger.info "#{config.name} is halted!" end end |