Sha256: dcde9cc13c0110c96d9603856857ad7f1d88704ee8cacc10f7fda754d7c9aa0c

Contents?: true

Size: 540 Bytes

Versions: 8

Compression:

Stored size: 540 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 #{id}"
        vm.instance.stop
        vm.instance.wait_for { printf "."; STDOUT.flush; state=="stopped"}
        puts 
      else
        puts "#{vm.name} has state: #{server.state} so we're not halting #{vm.name} - #{id}"        
      end
    end
  end
end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mccloud-0.0.8 lib/mccloud/command/halt.rb
mccloud-0.0.7 lib/mccloud/command/halt.rb
mccloud-0.0.6 lib/mccloud/command/halt.rb
mccloud-0.0.5 lib/mccloud/command/halt.rb
mccloud-0.0.4 lib/mccloud/command/halt.rb
mccloud-0.0.3 lib/mccloud/command/halt.rb
mccloud-0.0.2 lib/mccloud/command/halt.rb
mccloud-0.0.1 lib/mccloud/command/halt.rb