diff --git a/lib/vagrant/provisioners/chef.rb b/lib/vagrant/provisioners/chef.rb index a9d73718f..e0a6dc591 100644 --- a/lib/vagrant/provisioners/chef.rb +++ b/lib/vagrant/provisioners/chef.rb @@ -12,7 +12,7 @@ module Vagrant vm.ssh.execute do |ssh| # Checks for the existence of chef binary and error if it # doesn't exist. - ssh.exec!("which #{binary}", :error_key => :chef_not_detected, :error_data => {:binary => binary}) + ssh.exec!("which #{binary}", :error_class => ChefError, :_key => :chef_not_detected, :binary => binary) end end diff --git a/lib/vagrant/systems/linux.rb b/lib/vagrant/systems/linux.rb index b1480a455..50d7833a5 100644 --- a/lib/vagrant/systems/linux.rb +++ b/lib/vagrant/systems/linux.rb @@ -68,7 +68,7 @@ module Vagrant # interface file. vm.ssh.execute do |ssh| # Verify debian/ubuntu - ssh.exec!("cat /etc/debian_version", :error_key => :network_not_debian) + ssh.exec!("cat /etc/debian_version", :error_class => LinuxError, :_key => :network_not_debian) # Clear out any previous entries ssh.exec!("sudo sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces") diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 4e52dd924..6c80fc4d6 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -308,6 +308,11 @@ en: running_client: "Running chef-client..." running_solo: "Running chef-solo..." invalid_provisioner: "Vagrant::Provisioners::Chef is not a valid provisioner! Use ChefSolo or ChefServer instead." + not_detected: |- + The `%{binary}` binary appears to not be in the PATH of the guest. This + could be because the PATH is not properly setup or perhaps chef is not + installed on this guest. Chef provisioning can not continue without + chef properly installed. server_url_required: |- Chef server provisioning requires that the `config.chef.chef_server_url` be set to the URL of your chef server. Examples include "http://12.12.12.12:4000" and @@ -324,3 +329,13 @@ en: linux: attempting_halt: "Attempting graceful shutdown of linux..." mount_fail: "Failed to mount shared folders. `vboxsf` was not available." + network_not_debian: |- + Host only networking is only supported for Debian/Ubuntu by the built-in + "Linux" system. If you're using some other distro and want to implement + host only networking, please subclass the `Vagrant::Systems::Linux` class + and implement the `prepare_host_only_network` and `enable_host_only_network` + methods. + + Otherwise, please report your distro and how to modify network interfaces + to the Vagrant mailing list or IRC and we'll probably be glad to add it + to the internal systems. diff --git a/templates/strings.yml b/templates/strings.yml index 02e37cbc7..d4107c9c5 100644 --- a/templates/strings.yml +++ b/templates/strings.yml @@ -7,33 +7,6 @@ #--------------------------------------------------------------------- # CATEGORY: Error Messages #--------------------------------------------------------------------- -:box_file_exists: |- - The specified output file for packaging already exists. Please move - the file or modify the output filename parameter then try to package - again. - - Specified output file: <%= output_file %> -:box_remove_doesnt_exist: |- - The box you're attempting to remove does not exist! -:box_repackage_doesnt_exist: |- - The box you're attempting to repackage does not exist. Please check the - name you specified and try again. As a reminder, the repackage - command is for repackaging boxes which have been added through `vagrant box add` - but the box has been lost. -:chef_not_detected: |- - The `<%= binary %>` binary appears to not be in the PATH of the guest. This - could be because the PATH is not properly setup or perhaps chef is not - installed on this guest. Chef provisioning can not continue without - chef properly installed. -:command_box_invalid: |- - Please specify a valid action to take on the boxes, either - `add` or `remove`. Examples: - - vagrant box add name uri - vagrant box remove name - vagrant box list -:package_requires_export: |- - Package must be used in conjunction with export. :system_invalid_class: |- The specified system does not inherit from `Vagrant::Systems::Base`. The specified system class must inherit from this class. @@ -45,16 +18,3 @@ :system_unspecified: |- A VM system type must be specified! This is done via the `config.vm.system` configuration value. Please read the documentation online for more information. -#--------------------------------------------------------------------- -# CATEGORY: Error Messages for Linux System -#--------------------------------------------------------------------- -:network_not_debian: |- - Host only networking is only supported for Debian/Ubuntu by the built-in - "Linux" system. If you're using some other distro and want to implement - host only networking, please subclass the `Vagrant::Systems::Linux` class - and implement the `prepare_host_only_network` and `enable_host_only_network` - methods. - - Otherwise, please report your distro and how to modify network interfaces - to the Vagrant mailing list or IRC and we'll probably be glad to add it - to the internal systems. diff --git a/test/vagrant/provisioners/chef_test.rb b/test/vagrant/provisioners/chef_test.rb index 4d4e92380..25a12866d 100644 --- a/test/vagrant/provisioners/chef_test.rb +++ b/test/vagrant/provisioners/chef_test.rb @@ -73,7 +73,7 @@ class ChefProvisionerTest < Test::Unit::TestCase should "verify binary exists" do binary = "foo" - @ssh.expects(:exec!).with("which #{binary}", :error_key => :chef_not_detected, :error_data => { :binary => binary }).once + @ssh.expects(:exec!).with("which #{binary}", anything) @action.verify_binary(binary) end end