Fix hook appending to up and destroy actions.
This commit is contained in:
parent
693f6a3181
commit
e08fc6a811
1
Gemfile
1
Gemfile
|
@ -1,3 +1,4 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gem 'vagrant', :git => 'git://github.com/mitchellh/vagrant.git', :tag => 'v1.1.5'
|
||||||
gemspec
|
gemspec
|
||||||
|
|
|
@ -13,24 +13,21 @@ module VagrantPlugins
|
||||||
action_hook(:hostmanager_up, :machine_action_up) do |hook|
|
action_hook(:hostmanager_up, :machine_action_up) do |hook|
|
||||||
setup_i18n
|
setup_i18n
|
||||||
setup_logging
|
setup_logging
|
||||||
|
hook.append(Action::UpdateHostsFile)
|
||||||
# TODO use hook.append when defect is fixed within vagrant
|
|
||||||
hook.after(ProviderVirtualBox::Action::Boot, Action::UpdateHostsFile)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
action_hook(:hostmanger_destroy, :machine_action_destroy) do |hook|
|
action_hook(:hostmanger_destroy, :machine_action_destroy) do |hook|
|
||||||
setup_i18n
|
setup_i18n
|
||||||
setup_logging
|
setup_logging
|
||||||
|
hook.append(Action::UpdateHostsFile)
|
||||||
# TODO use hook.append when defect is fixed within vagrant
|
|
||||||
hook.after(
|
|
||||||
ProviderVirtualBox::Action::DestroyUnusedNetworkInterfaces,
|
|
||||||
Action::UpdateHostsFile)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.setup_i18n
|
def self.setup_i18n
|
||||||
I18n.load_path << File.expand_path('locales/en.yml', HostManager.source_root)
|
I18n.load_path << File.expand_path(
|
||||||
|
'locales/en.yml',
|
||||||
|
HostManager.source_root)
|
||||||
I18n.reload!
|
I18n.reload!
|
||||||
|
|
||||||
Helpers::Translator.plugin_namespace = 'vagrant_hostmanager'
|
Helpers::Translator.plugin_namespace = 'vagrant_hostmanager'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module HostManager
|
module HostManager
|
||||||
VERSION = '0.0.1'
|
VERSION = '0.0.2'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# -*- mode: ruby -*-
|
# -*- mode: ruby -*-
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
Vagrant.require_plugin('vagrant-hostmanager')
|
||||||
|
|
||||||
Vagrant.configure('2') do |config|
|
Vagrant.configure('2') do |config|
|
||||||
config.vm.box = 'precise64-chef11.2'
|
config.vm.box = 'precise64-chef11.2'
|
||||||
config.vm.box_url = 'https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.2.0.box'
|
config.vm.box_url = 'https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.2.0.box'
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
gem uninstall -a vagrant-hostmanager
|
|
||||||
gem build *.gemspec
|
|
||||||
gem install *.gem
|
|
||||||
rm *.gem
|
|
||||||
vagrant plugin install vagrant-hostmanager
|
|
||||||
|
|
||||||
cd test
|
cd test
|
||||||
|
|
||||||
vagrant up
|
vagrant up
|
||||||
|
|
Loading…
Reference in New Issue