deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/3] git commit: Minor edit to OpenNebula driver - allows use of API_PROVIDER environment variable.
Date Wed, 15 Feb 2012 09:23:14 GMT
Minor edit to OpenNebula driver - allows use of API_PROVIDER environment variable.

Can use either API_PROVIDER (or -P option to deltacloudd) or OCCI_URL environment variables
to specify location of the OpenNebula server. If both are set, OCCI_URL will take precendence.


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

Branch: refs/heads/master
Commit: abf68f348f7c1ed212bdf9f84b4f4911adce61a0
Parents: eeb773e
Author: marios <marios@redhat.com>
Authored: Tue Feb 14 15:19:35 2012 +0200
Committer: marios <marios@redhat.com>
Committed: Tue Feb 14 15:19:35 2012 +0200

----------------------------------------------------------------------
 .../deltacloud/drivers/opennebula/occi_client.rb   |    9 ++-------
 .../drivers/opennebula/opennebula_driver.rb        |    2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/abf68f34/server/lib/deltacloud/drivers/opennebula/occi_client.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/opennebula/occi_client.rb b/server/lib/deltacloud/drivers/opennebula/occi_client.rb
index 3eab5d7..574cb88 100644
--- a/server/lib/deltacloud/drivers/opennebula/occi_client.rb
+++ b/server/lib/deltacloud/drivers/opennebula/occi_client.rb
@@ -40,13 +40,8 @@ module OCCIClient
       @timeout = timeout
 
       # Server location
-      if endpoint_str
-        @endpoint =  endpoint_str
-      elsif ENV["OCCI_URL"]
-        @endpoint = ENV["OCCI_URL"]
-      else
-        @endpoint = "http://localhost:4567"
-      end
+      @endpoint = ENV["OCCI_URL"] || endpoint_str || Proc.new(raise "No OpenNebula Provider
location configured! Client needs to set \'X-Deltacloud-Provider\' HTTP request header, OR,
Deltacloud server administrator must set either the OCCI_URL or API_PROVIDER environment variables")
+#"http://localhost:4567"
 
       # Autentication
       if user && pass

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/abf68f34/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
index 81a1290..3b00eca 100644
--- a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
+++ b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
@@ -219,7 +219,7 @@ class OpennebulaDriver < Deltacloud::BaseDriver
   private
 
   def new_client(credentials)
-    OCCIClient::Client.new(nil, credentials.user, credentials.password, false)
+    OCCIClient::Client.new(api_provider, credentials.user, credentials.password, false)
   end
 
 


Mime
View raw message