deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject [2/2] git commit: FGCP: read FGCP_CERT_DIR env var in method instead of start of class to allow unit tests to set it. The old way stopped working because drivers are now preloaded at startup.
Date Fri, 24 May 2013 09:21:46 GMT
FGCP: read FGCP_CERT_DIR env var in method instead of start of class
to allow unit tests to set it.
The old way stopped working because drivers are now preloaded at startup.


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

Branch: refs/heads/master
Commit: df53052e4d4146e88cb3005238f04e616b09d414
Parents: ffe95a8
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Wed May 22 08:50:16 2013 +1000
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Fri May 24 19:06:57 2013 +1000

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/df53052e/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
index 3410495..081390e 100644
--- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
+++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
@@ -26,8 +26,6 @@ module Deltacloud
     module Fgcp
 class FgcpDriver < Deltacloud::BaseDriver
 
-  CERT_DIR = ENV['FGCP_CERT_DIR'] || File::expand_path('~/.deltacloud/drivers/fgcp')
-
   feature :instances, :user_name
   feature :instances, :metrics
   feature :instances, :realm_filter
@@ -1594,7 +1592,8 @@ eofwopxml
 
   def convert_credentials(credentials)
     begin
-      cert_file = File.open(File::join(CERT_DIR, credentials.user, 'UserCert.p12'), 'rb')
+      cert_dir = ENV['FGCP_CERT_DIR'] || File::expand_path('~/.deltacloud/drivers/fgcp')
+      cert_file = File.open(File::join(cert_dir, credentials.user, 'UserCert.p12'), 'rb')
     rescue Errno::ENOENT => e # file not found
       raise "AuthFailure: No certificate registered under name \'#{credentials.user}\'"
 #      raise Deltacloud::ExceptionHandler::AuthenticationFailure.new(e, "No certificate registered
under name #{credentials.user}")


Mime
View raw message