From 24dc1c8ed6eb6c6fc45dc7acf5af1a429ea0d162 Mon Sep 17 00:00:00 2001 From: Lukasz Jastrzebski Date: Thu, 19 Dec 2013 14:25:05 -0800 Subject: [PATCH] fixing incorrect merge --- lib/vagrant-hostmanager/hosts_file.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/vagrant-hostmanager/hosts_file.rb b/lib/vagrant-hostmanager/hosts_file.rb index 54863e2..e7f0f80 100644 --- a/lib/vagrant-hostmanager/hosts_file.rb +++ b/lib/vagrant-hostmanager/hosts_file.rb @@ -60,7 +60,6 @@ module VagrantPlugins entries = [] destroyed_entries = [] ids = [] - hosts_aliases = [] get_machines.each do |name, p| if @provider == p machine = @global_env.machine(name, p) @@ -71,9 +70,8 @@ module VagrantPlugins if id.nil? destroyed_entries << "#{ip}\t#{host} #{aliases}" else - entries << "#{ip}\t#{host} #{aliases}\t# VAGRANT ID: #{id}\n" + entries << "#{ip}\t#{host} #{aliases}\t# VAGRANT ID: #{id}\n" ids << id unless ids.include?(id) - hosts_aliases << "#{host} #{aliases}" end end end @@ -84,7 +82,6 @@ module VagrantPlugins File.open(file).each_line do |line| # Eliminate lines for machines that have been destroyed next if destroyed_entries.any? { |entry| line =~ /^#{entry}\t# VAGRANT ID: .*/ } - next if hosts_aliases.any? { |host_aliases| line =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s#{host_aliases}\s# VAGRANT ID:\s.*/} tmp_file << line unless ids.any? { |id| line =~ /# VAGRANT ID: #{id}/ } end