From 82183955463aa657a5f82ab318cc868edfd285a5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 12 Apr 2010 21:03:13 -0700 Subject: [PATCH] ssh-config should require root path, not a created environment --- lib/vagrant/commands.rb | 2 +- test/vagrant/commands_test.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/commands.rb b/lib/vagrant/commands.rb index 8d9cf6f93..77b954a44 100644 --- a/lib/vagrant/commands.rb +++ b/lib/vagrant/commands.rb @@ -64,7 +64,7 @@ module Vagrant # Outputs a valid entry for .ssh/config which can be used to connect # to this environment. def ssh_config - env.require_persisted_vm + env.require_root_path puts TemplateRenderer.render("ssh_config", { :host_key => "vagrant", :ssh_user => env.config.ssh.username, diff --git a/test/vagrant/commands_test.rb b/test/vagrant/commands_test.rb index 0b832a0c1..8267f5865 100644 --- a/test/vagrant/commands_test.rb +++ b/test/vagrant/commands_test.rb @@ -113,6 +113,14 @@ class CommandsTest < Test::Unit::TestCase @ssh = mock("ssh") @ssh.stubs(:port).returns(2197) @env.stubs(:ssh).returns(@ssh) + @env.stubs(:require_root_path) + + @commands.stubs(:puts) + end + + should "require root path" do + @env.expects(:require_root_path).once + @commands.ssh_config end should "output rendered template" do