providers/virtualbox: style nitpick

This commit is contained in:
Mitchell Hashimoto 2014-03-11 08:48:33 -07:00
parent 2a93b6c396
commit 0f70ce7e46
1 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,9 @@ module VagrantPlugins
if !name if !name
prefix = "#{env[:root_path].basename.to_s}_#{env[:machine].name}" prefix = "#{env[:root_path].basename.to_s}_#{env[:machine].name}"
prefix.gsub!(/[^-a-z0-9_]/i, "") prefix.gsub!(/[^-a-z0-9_]/i, "")
# milliseconds + random number suffix to allow for simultaneous `vagrant up` of the same box in different dirs
# milliseconds + random number suffix to allow for simultaneous
# `vagrant up` of the same box in different dirs
name = prefix + "_#{(Time.now.to_f * 1000.0).to_i}_#{rand(100000)}" name = prefix + "_#{(Time.now.to_f * 1000.0).to_i}_#{rand(100000)}"
end end