Change libvirt method for creating storage pool

We should use define_storage pool_xml instead of create_storage_pool_xml
so that

* the pool is permanent
* pool creation succeeds if the directory does not already exist
This commit is contained in:
Brian Pitts 2014-12-07 14:25:54 -06:00
parent 47a21433a5
commit 8df13baade

View File

@ -34,8 +34,10 @@ module VagrantPlugins
# Fog libvirt currently doesn't support creating pools. Use
# ruby-libvirt client directly.
begin
libvirt_pool = env[:libvirt_compute].client.create_storage_pool_xml(
libvirt_pool = env[:libvirt_compute].client.define_storage_pool_xml(
to_xml('default_storage_pool'))
libvirt_pool.build
libvirt_pool.create
rescue => e
raise Errors::CreatingStoragePoolError,
:error_message => e.message