Sha256: cfd515e368104c9b300ad33fdae31fd44a48dfa592373cedb74fda6665a8fe82

Contents?: true

Size: 650 Bytes

Versions: 13

Compression:

Stored size: 650 Bytes

Contents

module Fog
  module Compute
    class OpenNebula
      class Real
        def vm_destroy(id)
          vmpool = ::OpenNebula::VirtualMachinePool.new(client)
          vmpool.info!(-2,id,id,-1)

          vmpool.each do |vm|
            # true => delete and recreate vm
            vm.delete(false)
          end
        end
      end

      class Mock
        def vm_destroy(id)
          response = Excon::Response.new
          response.status = 200

          self.data['vms'].each do |vm|
            if vm['id'] == id
              self.data['vms'].delete(vm)
            end
          end
          true
        end
      end
    end
  end
end

Version data entries

13 entries across 11 versions & 3 rubygems

Version Path
fog-2.3.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-ifeel-2.2.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-2.2.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-2.1.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/opennebula/requests/compute/vm_destroy.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/opennebula/requests/compute/vm_destroy.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-1.42.1 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-2.0.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-1.42.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-1.41.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-1.40.0 lib/fog/opennebula/requests/compute/vm_destroy.rb
fog-1.39.0 lib/fog/opennebula/requests/compute/vm_destroy.rb