Sha256: ff16e68b5b3d523b9e5bc2b11da9aeec6593aba1ac43cb6999b2eb12a074b8d6

Contents?: true

Size: 546 Bytes

Versions: 16

Compression:

Stored size: 546 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

16 entries across 16 versions & 1 rubygems

Version Path
mccloud-0.1.1 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.28 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.27 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.26 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.25 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.24 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.23 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.22 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.21 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.20 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.19 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.18 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.17 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.16 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.15 lib/mccloud/provider/core/vm/old_halt.rb
mccloud-0.0.14 lib/mccloud/provider/core/vm/old_halt.rb