1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #630 from rubiojr/implement-server-volume-destroy

* implement :destroy_volumes in Server.destroy (libvirt provider)
This commit is contained in:
Patrick Debois 2011-11-30 07:35:57 -08:00
commit b47b53def5

View file

@ -206,6 +206,13 @@ module Fog
@raw.destroy
end
@raw.undefine
if options[:destroy_volumes]
disk_path = document("domain/devices/disk/source", "file")
# volumes.all filters do not handle nil keys well
(connection.volumes.all(:path => disk_path) rescue []).each do |vol|
vol.destroy
end
end
end
def reboot