mirror of https://github.com/apache/kafka.git
Removed Vagrantfile hack which is no longer necessary with up-to-date versions of Vagrant, vagrant-hostmanager, and vagrant-aws
This commit is contained in:
parent
79eacf6c95
commit
8799afe319
|
@ -53,24 +53,6 @@ if File.exists?(local_config_file) then
|
||||||
eval(File.read(local_config_file), binding, "Vagrantfile.local")
|
eval(File.read(local_config_file), binding, "Vagrantfile.local")
|
||||||
end
|
end
|
||||||
|
|
||||||
# This is a horrible hack to work around bad interactions between
|
|
||||||
# vagrant-hostmanager and vagrant-aws/vagrant's implementation. Hostmanager
|
|
||||||
# wants to update the /etc/hosts entries, but tries to do so even on nodes that
|
|
||||||
# aren't up (e.g. even when all nodes are stopped and you run vagrant
|
|
||||||
# destroy). Because of the way the underlying code in vagrant works, it still
|
|
||||||
# tries to communicate with the node and has to wait for a very long
|
|
||||||
# timeout. This modifies the update to check for hosts that are not created or
|
|
||||||
# stopped, skipping the update in that case since it's impossible to update
|
|
||||||
# nodes in that state.
|
|
||||||
Object.const_get("VagrantPlugins").const_get("HostManager").const_get("HostsFile").class_eval do
|
|
||||||
def update_guest(machine)
|
|
||||||
state_id = machine.state.id
|
|
||||||
return if state_id == :not_created || state_id == :stopped
|
|
||||||
old_update_guest(machine)
|
|
||||||
end
|
|
||||||
alias_method :old_update_guest, :update_guest
|
|
||||||
end
|
|
||||||
|
|
||||||
# TODO(ksweeney): RAM requirements are not empirical and can probably be significantly lowered.
|
# TODO(ksweeney): RAM requirements are not empirical and can probably be significantly lowered.
|
||||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
config.hostmanager.enabled = true
|
config.hostmanager.enabled = true
|
||||||
|
|
Loading…
Reference in New Issue