incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH] Adds destroy_image for rackspace driver
Date Fri, 22 Jul 2011 08:29:13 GMT
On Jul 21, 2011, at 4:26 PM, marios@redhat.com wrote:

ACK.

 -- Michal

> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
> .../drivers/rackspace/rackspace_driver.rb          |   10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
> index 7829b02..e7c52d7 100644
> --- a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
> +++ b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
> @@ -109,6 +109,16 @@ class RackspaceDriver < Deltacloud::BaseDriver
>     end
>   end
> 
> +  def destroy_image(credentials, image_id)
> +    rax_client = new_client(credentials)
> +    safely do
> +      image = rax_client.get_image(image_id.to_i)
> +      unless image.delete!
> +        raise "ERROR: Cannot delete image with ID:#{image_id}"
> +      end
> +    end
> +  end
> +
>   def run_on_instance(credentials, opts={})
>     target = instance(credentials, :id => opts[:id])
>     param = {}
> -- 
> 1.7.3.4
> 

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org


Mime
View raw message