Sha256: e2239c900e41a5a3aa7d2e64527f5f97394acedb7dd98455dea2a60cb4807f1b

Contents?: true

Size: 519 Bytes

Versions: 5

Compression:

Stored size: 519 Bytes

Contents

require 'mccloud/util/iterator'

module Mccloud
  module Command
  include Mccloud::Util
  def halt(selection=nil,options=nil)
    on_selected_machines(selection) do |id,vm|
       unless vm.instance.state == "stopping" || vm.instance.state =="stopped"
        puts "Halting machine #{vm.name}(#{id})"
        vm.instance.stop
        vm.instance.wait_for { printf "."; STDOUT.flush; state=="stopped"}
        puts 
      else
        puts "#{vm.name}(#{id}) is already halted."        
      end
    end
  end
end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mccloud-0.0.13 lib/mccloud/command/halt.rb
mccloud-0.0.12 lib/mccloud/command/halt.rb
mccloud-0.0.11 lib/mccloud/command/halt.rb
mccloud-0.0.10 lib/mccloud/command/halt.rb
mccloud-0.0.9 lib/mccloud/command/halt.rb