deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: ovirt driver: support user-level API
Date Fri, 21 Dec 2012 12:01:45 GMT
Updated Branches:
  refs/heads/master acfc706e0 -> f14acd65f


ovirt driver: support user-level API

This patch contains the necessary changes to support the oVirt engine
user-level API.

The current way of configuring that is to use the API_PROVIDER
environment variable:
1. API_PROVIDER="http://server:port/api;;USER" - User API (no DC-id)
2. API_PROVIDER="http://server:port/api" - no DC-id, Admin API
3. API_PROVIDER="http://server:port/api;dc-id;USER" - User API (dc-id is
ignored by rbovirt)
4. API_PROVIDER="http://server:port/api;dc-id" - Admin API working in a specific
DC scope


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

Branch: refs/heads/master
Commit: f14acd65fb8521aa84d3d7b49f19bb010260552b
Parents: acfc706
Author: Oved Ourfali <oourfali@redhat.com>
Authored: Mon Dec 10 10:44:57 2012 +0200
Committer: marios <marios@redhat.com>
Committed: Fri Dec 21 13:39:27 2012 +0200

----------------------------------------------------------------------
 .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/f14acd65/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
index 7709be4..322f9d3 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
@@ -206,8 +206,13 @@ class RhevmDriver < Deltacloud::BaseDriver
   def new_client(credentials)
     safely do
       raise 'No API provider set for this request.' unless api_provider
-      url, datacenter = api_provider.split(';')
-      OVIRT::Client.new(credentials.user, credentials.password, url, datacenter)
+      url, datacenter, filtered = api_provider.split(';')
+      if filtered.nil?
+        OVIRT::Client.new(credentials.user, credentials.password, url, datacenter)
+      else
+        filtered_api = filtered.upcase == 'USER'
+        OVIRT::Client.new(credentials.user, credentials.password, url, datacenter, nil, filtered_api)
+      end
     end
   end
 


Mime
View raw message