lib/swa/ec2/image.rb in swa-0.4.2 vs lib/swa/ec2/image.rb in swa-0.4.3

- old
+ new

@@ -19,9 +19,20 @@ def name ami.name end delegate :creation_date + delegate :deregister + + def delete + ebs_snapshot_ids = ami.block_device_mappings.map do |mapping| + mapping.ebs.snapshot_id if mapping.ebs + end.compact + deregister + ebs_snapshot_ids.each do |snapshot_id| + ami.client.delete_snapshot(:snapshot_id => snapshot_id) + end + end private alias_method :ami, :aws_resource