deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Vollero <fvoll...@redhat.com>
Subject [PATCH core] Changed valid_credentials? to handle right exceptions
Date Wed, 01 Feb 2012 12:52:42 GMT

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