-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #182 and #131 #211
base: master
Are you sure you want to change the base?
Fixes #182 and #131 #211
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ module Util | |
def self.get_config(env) | ||
# config_global has been removed from v1.5 | ||
if Gem::Version.new(::Vagrant::VERSION) >= Gem::Version.new('1.5') | ||
env.vagrantfile.config | ||
env.vagrantfile.config[:hostmanager] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect this function is part of the problem, in that it's not actually retrieving the correct config block. Rewriting this as the following might solve the problem fully, but I'd need to test to confirm:
Then change all calls to pass in:
Using the env that is passed to |
||
else | ||
env.config_global | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being familiar with how a number of other plugins accomplish this, I'm pretty certain it's only supposed to be needed for complex types such as hashes, arrays, or attributes that are based on multiple settings. So I would have thought that only
@aliases
would have needed to be merged, and perhaps this is masking some other issue?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @electrofelix,
Thanks for your feedback, based on your comment I see that I forgot to add a merge for
@aliases
, will try to update the PR ASAP.Regarding the PR itself I'm not a Ruby developer (Nor developer at all) but this patch is to fix the issue when you configure
vagrant-hostmanager
in the base box and you just do:vagrant init my/basebox
vagrant up
With this patch you can configure
vagrant-hostmanager
in the Vagrantfile included in the box and when you dovagrant up
it will merge configurations (In case you have configured it in the local Vagrantfile).Hope it clarifies why I tried to do this.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully understand there is an issue around it not merging. The files merged are supposed to be from the box, from the current path and from the users global space ~/.vagrant.d/Vagrantfile.
What I'm saying is that this works out of the box for simple objects for other vagrant plugins, so likely missing something else about how vagrant-hostmanager has been coded in that it's not working by default for the simple true/false settings.
Should only require custom merging for the additional complex data elements that cannot necessarily merge correctly. I'd certainly think it's worth looking closer at the config file that is being used in the snipet below for lib/vagrant-hostmanager/util.rb since taking the config section directly from env.vagrantfile looks suspicious to me.