Sha256: 3c1c4926a1f4866415f7fe05018fdfaafe0d664ab0ab8f6a747124713ca1cd18

Contents?: true

Size: 574 Bytes

Versions: 11

Compression:

Stored size: 574 Bytes

Contents

require 'mccloud/util/iterator'

module Mccloud
  module Command
    def destroy(selection=nil,options=nil)
      on_selected_machines(selection) do |id,vm|
        unless vm.instance.nil? || vm.instance.state == "shutting-down" || vm.instance.state =="terminated"
          puts "Destroying machine #{vm.name} (#{id})"
          vm.instance.destroy
          
          vm.instance.wait_for {  print "."; STDOUT.flush; state=="terminated"}
          puts
        else
          puts "Machine #{vm.name} is already terminated"        
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mccloud-0.0.13 lib/mccloud/command/destroy.rb
mccloud-0.0.12 lib/mccloud/command/destroy.rb
mccloud-0.0.11 lib/mccloud/command/destroy.rb
mccloud-0.0.10 lib/mccloud/command/destroy.rb
mccloud-0.0.9 lib/mccloud/command/destroy.rb
mccloud-0.0.8 lib/mccloud/command/destroy.rb
mccloud-0.0.7 lib/mccloud/command/destroy.rb
mccloud-0.0.6 lib/mccloud/command/destroy.rb
mccloud-0.0.5 lib/mccloud/command/destroy.rb
mccloud-0.0.4 lib/mccloud/command/destroy.rb
mccloud-0.0.3 lib/mccloud/command/destroy.rb