deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: Changed valid_credentials? to handle right exceptions
Date Wed, 01 Feb 2012 13:56:04 GMT
Updated Branches:
  refs/heads/master eef9d0eb5 -> 2fbc147f9


Changed valid_credentials? to handle right exceptions

Signed-off-by: Francesco Vollero <fvollero@redhat.com>


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/2fbc147f
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/2fbc147f
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/2fbc147f

Branch: refs/heads/master
Commit: 2fbc147f9e3041b19f2c89e4d222ba2185486405
Parents: eef9d0e
Author: Francesco Vollero <fvollero@redhat.com>
Authored: Wed Feb 1 13:52:42 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Wed Feb 1 14:56:14 2012 +0100

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2fbc147f/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
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


Mime
View raw message