From cb5f6b57f46da1074bbfb26023206e327ebcfd1e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 3 Dec 2011 18:10:51 -0800 Subject: [PATCH] Remove Vagrant 0.8.0 transition code. --- lib/vagrant/environment.rb | 21 -------------- test/unit_legacy/vagrant/environment_test.rb | 30 -------------------- 2 files changed, 51 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 74ec0e1c3..e64861517 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -115,27 +115,6 @@ module Vagrant @_home_path ||= Pathname.new(File.expand_path(ENV["VAGRANT_HOME"] || DEFAULT_HOME)) @logger.info("Home path: #{@_home_path}") - - # This is the old default that Vagrant used to be put things into - # up until Vagrant 0.8.0. We keep around an automatic migration - # script here in case any old users upgrade. - old_home = File.expand_path("~/.vagrant") - if File.exists?(old_home) && File.directory?(old_home) - @logger.info("Found both an old and new Vagrantfile. Migration initiated.") - - # We can't migrate if the home directory already exists - if File.exists?(@_home_path) - ui.warn I18n.t("vagrant.general.home_dir_migration_failed", - :old => old_home, - :new => @_home_path.to_s) - else - # If the new home path doesn't exist, simply transition to it - ui.info I18n.t("vagrant.general.moving_home_dir", :directory => @_home_path) - FileUtils.mv(old_home, @_home_path) - end - end - - # Return the home path @_home_path end diff --git a/test/unit_legacy/vagrant/environment_test.rb b/test/unit_legacy/vagrant/environment_test.rb index 635cf5ad1..6e944839e 100644 --- a/test/unit_legacy/vagrant/environment_test.rb +++ b/test/unit_legacy/vagrant/environment_test.rb @@ -79,36 +79,6 @@ class EnvironmentTest < Test::Unit::TestCase expected = Pathname.new(File.expand_path(ENV["VAGRANT_HOME"])) assert_equal expected, @env.home_path end - - should "move the old home directory to the new location" do - new_path = @home_path.join(".vagrant.d") - old_path = @home_path.join(".vagrant") - old_path.mkdir - - # Get the home path - ENV["VAGRANT_HOME"] = new_path.to_s - - assert !new_path.exist? - assert_equal new_path, @env.home_path - assert !old_path.exist? - assert new_path.exist? - end - - should "not move the old home directory if the new one already exists" do - new_path = @home_path.join(".vagrant.d") - new_path.mkdir - - old_path = @home_path.join(".vagrant") - old_path.mkdir - - # Get the home path - ENV["VAGRANT_HOME"] = new_path.to_s - - assert new_path.exist? - assert_equal new_path, @env.home_path - assert old_path.exist? - assert new_path.exist? - end end context "temp path" do