Removed unused halt timeout and check interval settings.
This commit is contained in:
parent
ddc6853a4c
commit
f4b67df978
|
@ -1,29 +1,21 @@
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module GuestWindows
|
module GuestWindows
|
||||||
class Config < Vagrant.plugin("2", :config)
|
class Config < Vagrant.plugin("2", :config)
|
||||||
attr_accessor :halt_timeout
|
|
||||||
attr_accessor :halt_check_interval
|
|
||||||
attr_accessor :set_work_network
|
attr_accessor :set_work_network
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@halt_timeout = UNSET_VALUE
|
|
||||||
@halt_check_interval = UNSET_VALUE
|
|
||||||
@set_work_network = UNSET_VALUE
|
@set_work_network = UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate(machine)
|
def validate(machine)
|
||||||
errors = []
|
errors = []
|
||||||
|
|
||||||
errors << "windows.halt_timeout cannot be nil." if @halt_timeout.nil?
|
|
||||||
errors << "windows.halt_check_interval cannot be nil." if @halt_check_interval.nil?
|
|
||||||
errors << "windows.set_work_network cannot be nil." if @set_work_network.nil?
|
errors << "windows.set_work_network cannot be nil." if @set_work_network.nil?
|
||||||
|
|
||||||
{ "Windows Guest" => errors }
|
{ "Windows Guest" => errors }
|
||||||
end
|
end
|
||||||
|
|
||||||
def finalize!
|
def finalize!
|
||||||
@halt_timeout = 30 if @halt_timeout == UNSET_VALUE
|
|
||||||
@halt_check_interval = 1 if @halt_check_interval == UNSET_VALUE
|
|
||||||
@set_work_network = false if @set_work_network == UNSET_VALUE
|
@set_work_network = false if @set_work_network == UNSET_VALUE
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,14 +15,11 @@ describe VagrantPlugins::GuestWindows::Config do
|
||||||
|
|
||||||
describe "default values" do
|
describe "default values" do
|
||||||
before { subject.finalize! }
|
before { subject.finalize! }
|
||||||
|
|
||||||
its("halt_timeout") { should == 30 }
|
|
||||||
its("halt_check_interval") { should == 1 }
|
|
||||||
its("set_work_network") { should == false }
|
its("set_work_network") { should == false }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "attributes" do
|
describe "attributes" do
|
||||||
[:halt_timeout, :halt_check_interval, :set_work_network].each do |attribute|
|
[:set_work_network].each do |attribute|
|
||||||
it "should not default #{attribute} if overridden" do
|
it "should not default #{attribute} if overridden" do
|
||||||
subject.send("#{attribute}=".to_sym, 10)
|
subject.send("#{attribute}=".to_sym, 10)
|
||||||
subject.finalize!
|
subject.finalize!
|
||||||
|
|
Loading…
Reference in New Issue