deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH 3/3] Updated openstack driver for openstack compute v2.0 API (openstack compute release 'diablo')
Date Tue, 28 Feb 2012 23:41:13 GMT
Hi Marios,

On Tue, 2012-02-28 at 18:11 +0200, marios@redhat.com wrote:
> On 24/02/12 02:06, David Lutterkort wrote:

> yes, based on the Auth url provided as api_provider - i.e. the way the
> openstack gem does it. in theory, the openstack gem handles this so the
> driver should work for both... we need some testing against both
> versions and put in safety/begin-rescue clauses to handle the edge
> cases. I put in a private boolean method 'api_v2' for convenience in
> new_client (whether or not to blow up when its v2 and the client didn't
> provide both username and authtenant).

Good, I didn't realize that about the client.

> >> +        def destroy_image(credentials, image_id)
> >> +          os = new_client(credentials)
> >> +          safely do
> >> +            image = os.get_image(image_id)
> >> +            unless image.delete!
> >> +              raise "ERROR: Cannot delete image with ID:#{image_id}"
> > 
> > What error does that lead to in the API ? Can we pass on more
> > informative details based on what the backend tells us ?
> > 
> 
> actually, looking at the gem code some more
> [/gems/openstack-compute-1.1.7/lib/openstack/compute/image.rb:65]:
> 
>  the safely..do will handle that. image.delete! will blow up unless the
> operation is successful. In other words, the image.delete! method
> returns true only if successful. Otherwise it raises an exception based
> on the response from the Openstack server. This exception will be
> propagated to the client because of safely..do. The actual errors that
> can be raised here as defined by the API are numerous:
> http://docs.openstack.org/api/openstack-compute/2/content/Delete_Image-d1e4957.html
> (computeFault (400, 500, …), serviceUnavailable (503), unauthorized
> (401), forbidden (403), badRequest (400), badMethod (405), overLimit
> (413), itemNotFound (404) )

Ok; nice. Just wanted to make sure we think of our poor users ;)

David



Mime
View raw message