deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1202134 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb
Date Tue, 15 Nov 2011 11:32:41 GMT
Author: mfojtik
Date: Tue Nov 15 11:32:41 2011
New Revision: 1202134

URL: http://svn.apache.org/viewvc?rev=1202134&view=rev
Log:
Mock: Use rather 'etc' library to get current username than environment variable

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb?rev=1202134&r1=1202133&r2=1202134&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/mock/mock_driver.rb Tue Nov 15
11:32:41 2011
@@ -15,10 +15,11 @@
 # under the License.
 
 
-require 'deltacloud/base_driver'
 require 'yaml'
-require 'deltacloud/drivers/mock/mock_client'
 require 'base64'
+require 'etc'
+require 'deltacloud/base_driver'
+require 'deltacloud/drivers/mock/mock_client'
 
 module Deltacloud::Drivers::Mock
 
@@ -90,7 +91,7 @@ module Deltacloud::Drivers::Mock
     def initialize
       if ENV["DELTACLOUD_MOCK_STORAGE"]
         storage_root = ENV["DELTACLOUD_MOCK_STORAGE"]
-      elsif ENV["USER"]
+      elsif Etc.getlogin
         storage_root = File::join("/var/tmp", "deltacloud-mock-#{ENV["USER"]}")
       else
         raise "Please set either the DELTACLOUD_MOCK_STORAGE or USER environment variable"



Mime
View raw message