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

* implement :destroy_volumes in Server.destroy (libvirt provider)

This commit is contained in:
Sergio Rubio 2011-11-30 13:15:12 +01:00
parent 6f1b9a3688
commit 6eba50d362

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