use a safer default name for virtualbox
if the same vagrantfile is up'd in the same second in the same basedir this caused a conflict, most notably, all jenkins jobs sit in a 'workspace' directory, which breaks if more than one job launches from the same trigger.
This commit is contained in:
parent
a92e03cf4c
commit
d775756d18
|
@ -23,7 +23,8 @@ module VagrantPlugins
|
|||
if !name
|
||||
prefix = "#{env[:root_path].basename.to_s}_#{env[:machine].name}"
|
||||
prefix.gsub!(/[^-a-z0-9_]/i, "")
|
||||
name = prefix + "_#{Time.now.to_i}"
|
||||
# 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)}"
|
||||
end
|
||||
|
||||
# Verify the name is not taken
|
||||
|
|
Loading…
Reference in New Issue