diff --git a/src/cloud/ec2/lib/EC2QueryClient.rb b/src/cloud/ec2/lib/EC2QueryClient.rb index 92bce3936e..ff38c28d84 100644 --- a/src/cloud/ec2/lib/EC2QueryClient.rb +++ b/src/cloud/ec2/lib/EC2QueryClient.rb @@ -44,9 +44,9 @@ module EC2QueryClient ec2auth = secret elsif ENV["EC2_ACCESS_KEY"] and ENV["EC2_SECRET_KEY"] ec2auth = ENV["EC2_ACCESS_KEY"] + ":" + ENV["EC2_SECRET_KEY"] - elsif ENV["ONE_AUTH"] and !ENV["ONE_AUTH"].empty? and File.exists?(ENV["ONE_AUTH"]) + elsif ENV["ONE_AUTH"] and !ENV["ONE_AUTH"].empty? and File.file?(ENV["ONE_AUTH"]) ec2auth=File.read(ENV["ONE_AUTH"]) - elsif File.exists?(ENV["HOME"]+"/.one/one_auth") + elsif File.file?(ENV["HOME"]+"/.one/one_auth") ec2auth=File.read(ENV["HOME"]+"/.one/one_auth") else raise "No authorization data present" diff --git a/src/cloud/occi/lib/ONEOCCIClient.rb b/src/cloud/occi/lib/ONEOCCIClient.rb index 5fe2388a45..092fcd2bb1 100755 --- a/src/cloud/occi/lib/ONEOCCIClient.rb +++ b/src/cloud/occi/lib/ONEOCCIClient.rb @@ -44,9 +44,9 @@ module ONEOCCIClient # Autentication if user && pass @occiauth = user + ":" + Digest::SHA1.hexdigest(pass) - elsif ENV["ONE_AUTH"] and !ENV["ONE_AUTH"].empty? and File.exists?(ENV["ONE_AUTH"]) + elsif ENV["ONE_AUTH"] and !ENV["ONE_AUTH"].empty? and File.file?(ENV["ONE_AUTH"]) one_auth=File.read(ENV["ONE_AUTH"]) - elsif File.exists?(ENV["HOME"]+"/.one/one_auth") + elsif File.file?(ENV["HOME"]+"/.one/one_auth") one_auth=File.read(ENV["HOME"]+"/.one/one_auth") else raise "No authorization data present"