From eb5111916574fcf338a2abc414dbef063d23a9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantino=20V=C3=A1zquez=20Blanco?= Date: Wed, 22 Jul 2009 15:54:32 +0000 Subject: [PATCH] Changing class variable to globar variable in oca lib git-svn-id: http://svn.opennebula.org/one/trunk@731 3034c82b-c49b-4eb3-8279-a7acafdc01c0 --- src/oca/ec2/econe-register | 2 +- src/oca/ec2/lib/EC2QueryClient.rb | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/oca/ec2/econe-register b/src/oca/ec2/econe-register index fa83022370..f83f6874f7 100755 --- a/src/oca/ec2/econe-register +++ b/src/oca/ec2/econe-register @@ -16,7 +16,7 @@ # --access-key , -K : # The username of the user # -# --secret-key , -K : +# --secret-key , -S : # The password of the user # # --url , -U : diff --git a/src/oca/ec2/lib/EC2QueryClient.rb b/src/oca/ec2/lib/EC2QueryClient.rb index 894d59ba0f..cabaf6e277 100644 --- a/src/oca/ec2/lib/EC2QueryClient.rb +++ b/src/oca/ec2/lib/EC2QueryClient.rb @@ -1,9 +1,9 @@ #!/usr/bin/ruby -@@ec2url = nil +$ec2url = nil if ENV["EC2_URL"] - @@ec2url = ENV["EC2_URL"] + $ec2url = ENV["EC2_URL"] ENV["EC2_URL"]=nil end @@ -35,6 +35,8 @@ module EC2QueryClient ec2auth = ENV["EC2_ACCESS_KEY"] + ":" + ENV["EC2_SECRET_KEY"] elsif ENV["ONE_AUTH"] ec2auth = ENV["ONE_AUTH"] + elsif + raise "No authorization data present" end ec2auth=~/(\w+):(\w+)/ @@ -45,8 +47,8 @@ module EC2QueryClient # Server location if !endpoint - if @@ec2url - endpoint = @@ec2url + if $ec2url + endpoint = $ec2url else endpoint = "http://127.0.0.1:4567" end @@ -59,7 +61,7 @@ module EC2QueryClient elsif !@uri.host raise "Wrong URI format, host not found" end - + @ec2_connection = EC2::Base.new( :access_key_id => @access_key_id, :secret_access_key => @access_key_secret, @@ -189,8 +191,6 @@ module EC2QueryClient return response end end - - client = Client.new end