deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik ...@mifo.sk>
Subject Re: [PATCH core] Changed valid_credentials? to handle right exceptions
Date Wed, 01 Feb 2012 13:55:47 GMT
On Feb 1, 2012, at 1:52 PM, Francesco Vollero wrote:

ACK.

> 
> Signed-off-by: Francesco Vollero <fvollero@redhat.com>
> ---
> server/lib/deltacloud/drivers/ec2/ec2_driver.rb |   10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index 5c1ddcc..50bc39f 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -712,13 +712,15 @@ module Deltacloud
>         end
> 
>         def valid_credentials?(credentials)
> -          retval = true
>           begin
> -            realms(credentials)
> -          rescue
> +            realms(credentials) && true
> +          rescue Aws::AwsError::AuthFailure
>             retval = false
> +          rescue => e
> +            safely do
> +              raise e
> +            end
>           end
> -          retval
>         end
> 
>         private
> -- 
> 1.7.7.6
> 


Mime
View raw message