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'
|
||||
|
||||
gem 'vagrant', :git => 'git://github.com/mitchellh/vagrant.git', :tag => 'v1.1.5'
|
||||
gemspec
|
||||
|
|
|
@ -13,24 +13,21 @@ module VagrantPlugins
|
|||
action_hook(:hostmanager_up, :machine_action_up) do |hook|
|
||||
setup_i18n
|
||||
setup_logging
|
||||
|
||||
# TODO use hook.append when defect is fixed within vagrant
|
||||
hook.after(ProviderVirtualBox::Action::Boot, Action::UpdateHostsFile)
|
||||
hook.append(Action::UpdateHostsFile)
|
||||
end
|
||||
|
||||
action_hook(:hostmanger_destroy, :machine_action_destroy) do |hook|
|
||||
setup_i18n
|
||||
setup_logging
|
||||
|
||||
# TODO use hook.append when defect is fixed within vagrant
|
||||
hook.after(
|
||||
ProviderVirtualBox::Action::DestroyUnusedNetworkInterfaces,
|
||||
Action::UpdateHostsFile)
|
||||
hook.append(Action::UpdateHostsFile)
|
||||
end
|
||||
|
||||
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!
|
||||
|
||||
Helpers::Translator.plugin_namespace = 'vagrant_hostmanager'
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module VagrantPlugins
|
||||
module HostManager
|
||||
VERSION = '0.0.1'
|
||||
VERSION = '0.0.2'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.require_plugin('vagrant-hostmanager')
|
||||
|
||||
Vagrant.configure('2') do |config|
|
||||
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'
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
gem uninstall -a vagrant-hostmanager
|
||||
gem build *.gemspec
|
||||
gem install *.gem
|
||||
rm *.gem
|
||||
vagrant plugin install vagrant-hostmanager
|
||||
|
||||
cd test
|
||||
|
||||
vagrant up
|
||||
|
|
Loading…
Reference in New Issue