deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: [PATCH core 2/2] Google: Capture 401 and 409 errors
Date Wed, 26 Sep 2012 11:15:48 GMT
ACK

[marios@name server]$ rake test:drivers:google
Run options:

# Running tests:

........

Finished tests in 1.083920s, 7.3806 tests/s, 29.5225 assertions/s.

8 tests, 32 assertions, 0 failures, 0 errors, 0 skips


On 26/09/12 14:10, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mfojtik@redhat.com>
> 
> * Added 'exceptions {}' block to google driver
> * InvalidAccessKeyId and InvalidSecurity is now handled using 401 code
> * BucketNameUnavailable now handled with 409 (Conflict)
> 
> Signed-off-by: Michal fojtik <mfojtik@redhat.com>
> ---
>  server/lib/deltacloud/drivers/google/google_driver.rb |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/server/lib/deltacloud/drivers/google/google_driver.rb b/server/lib/deltacloud/drivers/google/google_driver.rb
> index 12b0bf0..e2f6c5d 100644
> --- a/server/lib/deltacloud/drivers/google/google_driver.rb
> +++ b/server/lib/deltacloud/drivers/google/google_driver.rb
> @@ -202,6 +202,19 @@ class GoogleDriver < Deltacloud::BaseDriver
>      return true
>    end
>  
> +  exceptions do
> +
> +    on /(InvalidAccessKeyId|InvalidSecurity)/ do
> +      status 401
> +    end
> +
> +    on /BucketNameUnavailable/ do
> +      message "Bucket name already taken"
> +      status 409
> +    end
> +
> +  end
> +
>    private
>  
>    def new_client(credentials)
> 


Mime
View raw message