Sha256: aaa1c2fb0ec2b432f5d14f9036632faafe8f9d9af44b05a58cccfb601f7d61ea

Contents?: true

Size: 687 Bytes

Versions: 13

Compression:

Stored size: 687 Bytes

Contents

module VagrantWindows
  module Guest
    module Cap
      class Halt
        def self.halt(machine)
          machine.communicate.execute("shutdown /s /t 1 /c \"Vagrant Halt\" /f /d p:4:1")

          # Wait until the VM's state is actually powered off. If this doesn't
          # occur within a reasonable amount of time (15 seconds by default),
          # then simply return and allow Vagrant to kill the machine.
          count = 0
          while machine.state != :poweroff
            count += 1

            return if count >= machine.config.windows.halt_timeout
            sleep machine.config.windows.halt_check_interval
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
vagrant-plugin-dummy-0.0.7 windows/guest/cap/halt.rb
vagrant-plugin-dummy-0.0.6 windows/guest/cap/halt.rb
vagrant-plugin-dummy-0.0.5 windows/guest/cap/halt.rb
vagrant-windows-1.3.0.pre.2 lib/vagrant-windows/guest/cap/halt.rb
vagrant-windows-1.3.0.pre.1 lib/vagrant-windows/guest/cap/halt.rb
vagrant-windows-1.2.3 lib/vagrant-windows/guest/cap/halt.rb
vagrant-windows-1.2.2 lib/vagrant-windows/guest/cap/halt.rb
vagrant-plugin-dummy-0.0.4 windows/guest/cap/halt.rb
vagrant-plugin-dummy-0.0.3 windows/guest/cap/halt.rb
vagrant-windows-1.2.1 lib/vagrant-windows/guest/cap/halt.rb
vagrant-plugin-dummy-0.0.1 windows/guest/cap/halt.rb
vagrant-plugin-dummy-0.0.2 windows/guest/cap/halt.rb
vagrant-windows-1.2.0 lib/vagrant-windows/guest/cap/halt.rb