From 83b2872ddba8551dcbe69ad14bf08d8aa4c246de Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 25 Aug 2010 16:01:56 -0700 Subject: [PATCH] The `target_vms` helper in multivm with no name specified will return all VMs, not the hash [closes GH-148] --- lib/vagrant/command/helpers.rb | 2 +- test/vagrant/command/helpers_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/command/helpers.rb b/lib/vagrant/command/helpers.rb index 7a398d99f..bbf39a3d2 100644 --- a/lib/vagrant/command/helpers.rb +++ b/lib/vagrant/command/helpers.rb @@ -12,7 +12,7 @@ module Vagrant @target_vms ||= begin if env.multivm? - return env.vms if !self.name + return env.vms.values if !self.name vm = env.vms[self.name.to_sym] raise VMNotFoundError.new("A VM by the name of `#{self.name}` was not found.") if !vm else diff --git a/test/vagrant/command/helpers_test.rb b/test/vagrant/command/helpers_test.rb index 21fbf6d43..57229f849 100644 --- a/test/vagrant/command/helpers_test.rb +++ b/test/vagrant/command/helpers_test.rb @@ -67,7 +67,7 @@ class CommandHelpersTest < Test::Unit::TestCase should "return all the VMs if no name is specified" do instance = command([], @env) - assert_equal @env.vms, instance.target_vms + assert_equal @env.vms.values, instance.target_vms end should "return only the specified VM if a name is given" do