Use hash of machine name for lock file to avoid problems with invalid characters for file names.

This commit is contained in:
Manuel Pöter 2015-08-12 14:25:54 +02:00
parent 772f276ee3
commit 2a2f0a4751
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ module VagrantPlugins
def call(env) def call(env)
master_id_file = env[:machine].box.directory.join("master_id") master_id_file = env[:machine].box.directory.join("master_id")
env[:machine].env.lock(env[:machine].box.name, retry: true) do env[:machine].env.lock(Digest::MD5.hexdigest(env[:machine].box.name), retry: true) do
env[:master_id] = master_id_file.read.chomp if master_id_file.file? env[:master_id] = master_id_file.read.chomp if master_id_file.file?
if env[:master_id] && env[:machine].provider.driver.vm_exists?(env[:master_id]) if env[:master_id] && env[:machine].provider.driver.vm_exists?(env[:master_id])
# Master VM already exists -> nothing to do - continue. # Master VM already exists -> nothing to do - continue.