Only check for .vmcx if there is no XML found to not risk breaking older vagrant boxes that added an XML file manually

This commit is contained in:
Bjorn Brala 2016-10-07 20:38:05 +02:00
parent 133e2a7b0f
commit a77da314e5
1 changed files with 14 additions and 5 deletions

View File

@ -37,19 +37,28 @@ module VagrantPlugins
config_path = nil
config_type = nil
vm_dir.each_child do |f|
if f.extname.downcase == '.xml'
config_path = f
config_type = 'xml'
break
end
if f.extname.downcase == '.vmcx'
config_path = f
config_type = 'vmcx'
break
end
# Only check for .vmcx if there is no XML found to not
# risk breaking older vagrant boxes that added an XML
# file manually
if config_type == nil
vm_dir.each_child do |f|
if f.extname.downcase == '.vmcx'
config_path = f
config_type = 'vmcx'
break
end
end
end
image_path = nil
image_ext = nil
image_filename = nil