mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 20:02:38 +09:00
Bug #4196: Copy one_auth initialization from client.rb
(cherry picked from commit 1cc56deab1)
This commit is contained in:
1 parent
51c43b80b8
commit
ef6fe4a3bb
1 file changed
+6
-2
@@ -307,11 +307,15 @@ module Service
|
||||
if @username.nil? && @password.nil?
|
||||
if ENV["ONE_AUTH"] and !ENV["ONE_AUTH"].empty? and File.file?(ENV["ONE_AUTH"])
|
||||
one_auth = File.read(ENV["ONE_AUTH"])
|
||||
elsif File.file?(ENV["HOME"]+"/.one/one_auth")
|
||||
elsif ENV["HOME"] and File.file?(ENV["HOME"]+"/.one/one_auth")
|
||||
one_auth = File.read(ENV["HOME"]+"/.one/one_auth")
|
||||
elsif File.file?("/var/lib/one/.one/one_auth")
|
||||
one_auth = File.read("/var/lib/one/.one/one_auth")
|
||||
else
|
||||
raise "ONE_AUTH file not present"
|
||||
end
|
||||
|
||||
one_auth.rstrip!
|
||||
one_auth = one_auth.rstrip
|
||||
|
||||
@username, @password = one_auth.split(':')
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user