Add lock around storage pool creation; closes #278

This commit is contained in:
Brian Pitts 2014-12-07 12:16:05 -06:00
parent 916ec6798f
commit 47a21433a5

View File

@ -6,12 +6,15 @@ module VagrantPlugins
class HandleStoragePool
include VagrantPlugins::ProviderLibvirt::Util::ErbTemplate
@@lock = Mutex.new
def initialize(app, env)
@logger = Log4r::Logger.new("vagrant_libvirt::action::handle_storage_pool")
@app = app
end
def call(env)
@@lock.synchronize do
# Get config options.
config = env[:machine].provider_config
@ -38,6 +41,7 @@ module VagrantPlugins
:error_message => e.message
end
raise Errors::NoStoragePool if !libvirt_pool
end
@app.call(env)
end