fixing incorrect merge

This commit is contained in:
Lukasz Jastrzebski 2013-12-19 14:25:05 -08:00
parent eea9c82d03
commit 24dc1c8ed6
1 changed files with 1 additions and 4 deletions

View File

@ -60,7 +60,6 @@ module VagrantPlugins
entries = [] entries = []
destroyed_entries = [] destroyed_entries = []
ids = [] ids = []
hosts_aliases = []
get_machines.each do |name, p| get_machines.each do |name, p|
if @provider == p if @provider == p
machine = @global_env.machine(name, p) machine = @global_env.machine(name, p)
@ -71,9 +70,8 @@ module VagrantPlugins
if id.nil? if id.nil?
destroyed_entries << "#{ip}\t#{host} #{aliases}" destroyed_entries << "#{ip}\t#{host} #{aliases}"
else 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) ids << id unless ids.include?(id)
hosts_aliases << "#{host} #{aliases}"
end end
end end
end end
@ -84,7 +82,6 @@ module VagrantPlugins
File.open(file).each_line do |line| File.open(file).each_line do |line|
# Eliminate lines for machines that have been destroyed # Eliminate lines for machines that have been destroyed
next if destroyed_entries.any? { |entry| line =~ /^#{entry}\t# VAGRANT ID: .*/ } 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}/ } tmp_file << line unless ids.any? { |id| line =~ /# VAGRANT ID: #{id}/ }
end end