mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Be tolerant about drivers not supporting listing snapshots
This commit is contained in:
parent
c065c1e6e5
commit
ecea549e7f
@ -20,6 +20,7 @@ module VagrantPlugins
|
|||||||
libvirt_domain = env[:machine].provider.driver.connection.client.lookup_domain_by_uuid(
|
libvirt_domain = env[:machine].provider.driver.connection.client.lookup_domain_by_uuid(
|
||||||
env[:machine].id
|
env[:machine].id
|
||||||
)
|
)
|
||||||
|
begin
|
||||||
libvirt_domain.list_snapshots.each do |name|
|
libvirt_domain.list_snapshots.each do |name|
|
||||||
@logger.info("Deleting snapshot '#{name}'")
|
@logger.info("Deleting snapshot '#{name}'")
|
||||||
begin
|
begin
|
||||||
@ -28,6 +29,11 @@ module VagrantPlugins
|
|||||||
raise Errors::DeleteSnapshotError, error_message: e.message
|
raise Errors::DeleteSnapshotError, error_message: e.message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
|
# Some drivers (xen) don't support getting list of snapshots,
|
||||||
|
# not much can be done here about it
|
||||||
|
@logger.warn("Failed to get list of snapshots")
|
||||||
|
end
|
||||||
|
|
||||||
# must remove managed saves
|
# must remove managed saves
|
||||||
libvirt_domain.managed_save_remove if libvirt_domain.has_managed_save?
|
libvirt_domain.managed_save_remove if libvirt_domain.has_managed_save?
|
||||||
|
Loading…
Reference in New Issue
Block a user