incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lalancette <clala...@redhat.com>
Subject [PATCH] Put the credentials check for mock in a safely block.
Date Tue, 07 Jun 2011 20:39:59 GMT
Otherwise, the "raise 'AuthFailure'" piece of code won't
display the correct error view.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
---
 server/lib/deltacloud/drivers/mock/mock_driver.rb |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
index b1506fa..9697e5b 100644
--- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -499,8 +499,10 @@ class MockDriver < Deltacloud::BaseDriver
   private
 
   def check_credentials(credentials)
-    if ( credentials.user != 'mockuser' ) or ( credentials.password != 'mockpassword' )
-      raise 'AuthFailure'
+    safely do
+      if ( credentials.user != 'mockuser' ) or ( credentials.password != 'mockpassword' )
+        raise 'AuthFailure'
+      end
     end
   end
 
-- 
1.7.4.4


Mime
View raw message