Sha256: 6690aefef60c69a228b0900aa4e4c1b820dde0469fb9efd231f52f4de7b02bd3

Contents?: true

Size: 680 Bytes

Versions: 17

Compression:

Stored size: 680 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(:name => @volume_name).first.empty?
        end

        def exists_vm?
          begin
            @connection.list_domains(:name => name)
          rescue Libvirt::RetrieveError
            false
          end
        end

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

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
veewee-0.5.0.alpha4 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.5.0.alpha3 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.5.0.alpha2 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.5.0.alpha1 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.5.1 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.5 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.5.pre1 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.4 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.3 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.2 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.1 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.4.0 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.12 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.11 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.10 lib/veewee/provider/kvm/box/helper/status.rb
veewee-0.3.9 lib/veewee/provider/kvm/box/helper/status.rb
veewee-atlassian-0.3.11 lib/veewee/provider/kvm/box/helper/status.rb