Sha256: 27fbce2e6a4fcf686336dfba9c31dd23cf7e5cae71356aff6def93fb6712d25c

Contents?: true

Size: 607 Bytes

Versions: 8

Compression:

Stored size: 607 Bytes

Contents

module Veewee
  module Provider
    module Kvm
      module BoxCommand
        def running?
          if exists_vm?
            @connection.servers.all(:name => name).first.ready?
          else
            false
          end
        end

        def exists?
          exists_volume? || exists_vm?
        end

        def exists_volume?
          @connection.list_volumes.find { |v| v[:name] == "#{name}.img" }
        end

        def exists_vm?
          @connection.list_domains.find { |d| d[:name] == name }
        end

      end # End Module
    end # End Module
  end # End Module
end # End Module

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
veewee-0.3.7 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.6 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.5 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.4 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.3 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.2 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.1 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.0.beta2 lib/veewee/provider/kvm/box/helper/status.rb