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:
commit
b47b53def5
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue