Sha256: f8fcf442473bbf596e40610483afb78c6a8a48e0259883a7db9c689dee5fbe12

Contents?: true

Size: 657 Bytes

Versions: 20

Compression:

Stored size: 657 Bytes

Contents

module Veewee
  module Provider
    module Virtualbox
      module BoxCommand

        def exists?
          return check?(:exists)
        end

        def running?
          return check?(:running)
        end

        private

        def check? type
          command = COMMANDS[type] % @vboxcmd
          shell_results=shell_exec("#{command}",{:mute => true})
          status=shell_results.stdout.split(/\n/).grep(/\"#{Regexp.escape(name)}\"/).size!=0

          env.logger.info("Vm #{type}? #{status}")
          return status
        end

        COMMANDS = { :running => "%s list runningvms", :exists => "%s list vms" }
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

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