Sha256: 41566ea7431aa861d2cee1936008abc27304f5fcb2c47c2df3ce2baea7855c46

Contents?: true

Size: 858 Bytes

Versions: 16

Compression:

Stored size: 858 Bytes

Contents

module Vagrant
  class Commands
    # Resume a running vagrant instance. This resumes an already suspended
    # instance (from {suspend}).
    #
    # This command requires that an instance already be brought up with
    # `vagrant up`.
    class Resume < Base
      Base.subcommand "resume", self
      description "Resumes a suspend vagrant environment"

      def execute(args=[])
        all_or_single(args, :resume)
      end

      def resume_single(name)
        vm = env.vms[name.to_sym]
        if vm.nil?
          error_and_exit(:unknown_vm, :vm => name)
          return # for tests
        end

        if vm.created?
          vm.resume
        else
          vm.env.logger.info "VM '#{name}' not created. Ignoring."
        end
      end

      def options_spec(opts)
        opts.banner = "Usage: vagrant resume"
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
vagrantup-0.5.4 lib/vagrant/commands/resume.rb
vagrantup-0.5.3 lib/vagrant/commands/resume.rb
vagrantup-0.5.2 lib/vagrant/commands/resume.rb
vagrantup-0.5.1 lib/vagrant/commands/resume.rb
vagrantup-0.5.0 lib/vagrant/commands/resume.rb
vagrantup-0.4.3.dev lib/vagrant/commands/resume.rb
vagrantup-0.4.1 lib/vagrant/commands/resume.rb
vagrantup-0.4.0 lib/vagrant/commands/resume.rb
vagrant-0.5.4 lib/vagrant/commands/resume.rb
vagrant-0.5.3 lib/vagrant/commands/resume.rb
vagrant-0.5.2 lib/vagrant/commands/resume.rb
vagrant-0.5.1 lib/vagrant/commands/resume.rb
vagrant-0.5.0 lib/vagrant/commands/resume.rb
vagrant-0.4.2 lib/vagrant/commands/resume.rb
vagrant-0.4.1 lib/vagrant/commands/resume.rb
vagrant-0.4.0 lib/vagrant/commands/resume.rb