Sha256: e17190bd5e83bd4385f97a12d8d0dbcfd9e23e42aa47f4df5960182bf09770fb

Contents?: true

Size: 722 Bytes

Versions: 21

Compression:

Stored size: 722 Bytes

Contents

require 'optparse'

module Vagrant
  module Command
    class Suspend < Base
      def execute
        options = {}

        opts = OptionParser.new do |opts|
          opts.banner = "Usage: vagrant suspend [vm-name]"
        end

        # Parse the options
        argv = parse_options(opts)
        return if !argv

        @logger.debug("'suspend' each target VM...")
        with_target_vms(argv[0]) do |vm|
          if vm.created?
            @logger.info("Suspending: #{vm.name}")
            vm.suspend
          else
            @logger.info("Not created: #{vm.name}. Not suspending.")
            vm.ui.info I18n.t("vagrant.commands.common.vm_not_created")
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
vagrantup-1.0.1 lib/vagrant/command/suspend.rb
vagrantup-1.0.0 lib/vagrant/command/suspend.rb
vagrantup-0.9.99.2 lib/vagrant/command/suspend.rb
vagrantup-0.9.99.1 lib/vagrant/command/suspend.rb
vagrantup-0.9.7 lib/vagrant/command/suspend.rb
vagrantup-0.9.6 lib/vagrant/command/suspend.rb
vagrantup-0.9.5 lib/vagrant/command/suspend.rb
vagrantup-0.9.4 lib/vagrant/command/suspend.rb
vagrantup-0.9.3 lib/vagrant/command/suspend.rb
vagrantup-0.9.2 lib/vagrant/command/suspend.rb
vagrantup-0.9.1 lib/vagrant/command/suspend.rb
vagrantup-0.9.0 lib/vagrant/command/suspend.rb
vagrant-1.0.1 lib/vagrant/command/suspend.rb
vagrant-1.0.0 lib/vagrant/command/suspend.rb
vagrant-0.9.7 lib/vagrant/command/suspend.rb
vagrant-0.9.5 lib/vagrant/command/suspend.rb
vagrant-0.9.4 lib/vagrant/command/suspend.rb
vagrant-0.9.3 lib/vagrant/command/suspend.rb
vagrant-0.9.2 lib/vagrant/command/suspend.rb
vagrant-0.9.1 lib/vagrant/command/suspend.rb