Skip to content

Commit f113535

Browse files
committed
allow all config variables to be set at top-level and overridden per-machine
All config variables now get initialized to UNSET_VALUE so that any per-machine variables that are unspecified can fall-through to a higher-level config when the config hierarchy is merged by vagrant. Fixes #91.
1 parent 378cfda commit f113535

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

lib/vagrant-hostmanager/config.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ class Config < Vagrant.plugin('2', :config)
1313
alias_method :manage_host?, :manage_host
1414

1515
def initialize
16-
@enabled = false
17-
@manage_host = UNSET_VALUE
18-
@ignore_private_ip = UNSET_VALUE
19-
@include_offline = UNSET_VALUE
20-
@aliases = []
21-
@ip_resolver = nil
16+
@enabled = UNSET_VALUE
17+
@manage_host = UNSET_VALUE
18+
@ignore_private_ip = UNSET_VALUE
19+
@include_offline = UNSET_VALUE
20+
@aliases = UNSET_VALUE
21+
@ip_resolver = UNSET_VALUE
2222
end
2323

2424
def finalize!
25-
@manage_host = false if @manage_host == UNSET_VALUE
26-
@ignore_private_ip = false if @ignore_private_ip == UNSET_VALUE
27-
@include_offline = false if @include_offline == UNSET_VALUE
25+
@enabled = false if @enabled == UNSET_VALUE
26+
@manage_host = false if @manage_host == UNSET_VALUE
27+
@ignore_private_ip = false if @ignore_private_ip == UNSET_VALUE
28+
@include_offline = false if @include_offline == UNSET_VALUE
29+
@aliases = [] if @aliases == UNSET_VALUE
30+
@ip_resolver = nil if @ip_resolver == UNSET_VALUE
31+
2832
@aliases = [ @aliases ].flatten
2933
end
3034

0 commit comments

Comments
 (0)