Linux system configurable via `config.linux`
This commit is contained in:
parent
d5866a1b54
commit
23857242f2
|
@ -8,6 +8,23 @@ module Vagrant
|
|||
# At any rate, this system implementation should server as an
|
||||
# example of how to implement any custom systems necessary.
|
||||
class Linux < Base
|
||||
# A custom config class which will be made accessible via `config.linux`
|
||||
# This is not necessary for all system implementers, of course. However,
|
||||
# generally, Vagrant tries to make almost every aspect of its execution
|
||||
# configurable, and this assists that goal.
|
||||
class LinuxConfig < Vagrant::Config::Base
|
||||
attr_accessor :halt_timeout
|
||||
attr_accessor :halt_check_interval
|
||||
|
||||
def initialize
|
||||
@halt_timeout = 15
|
||||
@halt_check_interval = 1
|
||||
end
|
||||
end
|
||||
|
||||
# Register config class
|
||||
Config.configures :linux, LinuxConfig
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# Overridden methods
|
||||
#-------------------------------------------------------------------
|
||||
|
@ -24,8 +41,8 @@ module Vagrant
|
|||
while vm.vm.state(true) != :powered_off
|
||||
count += 1
|
||||
|
||||
return if count >= 15
|
||||
sleep 1
|
||||
return if count >= vm.env.config.linux.halt_timeout
|
||||
sleep vm.env.config.linux.halt_check_interval
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@ class LinuxSystemTest < Test::Unit::TestCase
|
|||
@ssh_session.expects(:exec!).with("sudo halt").once
|
||||
@instance.halt
|
||||
end
|
||||
|
||||
# TODO: Sleep/timeout testing
|
||||
end
|
||||
|
||||
context "mounting shared folders" do
|
||||
|
|
Loading…
Reference in New Issue