From 990908c3ed8d504a2e9d983f04bf5b81f6ba467a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 29 Sep 2010 23:31:21 -0700 Subject: [PATCH] Fix some undefined error constants in commands --- CHANGELOG.md | 1 + lib/vagrant/command/box.rb | 4 ++-- lib/vagrant/command/ssh.rb | 4 ++-- lib/vagrant/command/ssh_config.rb | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea1279b4d..81a918e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 0.6.4 (unreleased) + - Fix some issues with undefined constants in command errors. - Replaced `Kernel#system` calls with custom `Vagrant::Util::Sh` method to fix strange error issues. diff --git a/lib/vagrant/command/box.rb b/lib/vagrant/command/box.rb index 00218774d..81e361555 100644 --- a/lib/vagrant/command/box.rb +++ b/lib/vagrant/command/box.rb @@ -11,14 +11,14 @@ module Vagrant desc "remove NAME", "Remove a box from the system" def remove(name) b = env.boxes.find(name) - raise BoxNotFound.new(:name => name) if !b + raise Errors::BoxNotFound.new(:name => name) if !b b.destroy end desc "repackage NAME", "Repackage an installed box into a `.box` file." def repackage(name) b = env.boxes.find(name) - raise BoxNotFound.new(:name => name) if !b + raise Errors::BoxNotFound.new(:name => name) if !b b.repackage end diff --git a/lib/vagrant/command/ssh.rb b/lib/vagrant/command/ssh.rb index 31e11f07a..6770870d5 100644 --- a/lib/vagrant/command/ssh.rb +++ b/lib/vagrant/command/ssh.rb @@ -24,14 +24,14 @@ module Vagrant end def ssh_connect - raise VMNotCreatedError.new if !ssh_vm.created? + raise Errors::VMNotCreatedError.new if !ssh_vm.created? ssh_vm.ssh.connect end def ssh_vm @ssh_vm ||= begin vm = self.name.nil? && env.multivm? ? env.primary_vm : nil - raise MultiVMTargetRequired.new(:command => "ssh") if !vm && target_vms.length > 1 + raise Errors::MultiVMTargetRequired.new(:command => "ssh") if !vm && target_vms.length > 1 vm = target_vms.first if !vm vm end diff --git a/lib/vagrant/command/ssh_config.rb b/lib/vagrant/command/ssh_config.rb index 0feb4f562..d8094a842 100644 --- a/lib/vagrant/command/ssh_config.rb +++ b/lib/vagrant/command/ssh_config.rb @@ -5,9 +5,9 @@ module Vagrant register "ssh_config", "outputs .ssh/config valid syntax for connecting to this environment via ssh" def execute - raise MultiVMTargetRequired.new(:command => "ssh_config") if target_vms.length > 1 + raise Errors::MultiVMTargetRequired.new(:command => "ssh_config") if target_vms.length > 1 vm = target_vms.first - raise VMNotCreatedError.new if !vm.created? + raise Errors::VMNotCreatedError.new if !vm.created? env.ui.info(Util::TemplateRenderer.render("ssh_config", { :host_key => options[:host] || "vagrant",