mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Add lock around storage pool creation; closes #278
This commit is contained in:
parent
916ec6798f
commit
47a21433a5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user