deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/7] Core: Make Deltacloud::Library return driver providers
Date Wed, 25 Jul 2012 13:23:15 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/api.rb |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/server/lib/deltacloud/api.rb b/server/lib/deltacloud/api.rb
index 2b520d4..587c667 100644
--- a/server/lib/deltacloud/api.rb
+++ b/server/lib/deltacloud/api.rb
@@ -65,7 +65,15 @@ module Deltacloud
     end
 
     def providers
-      Deltacloud.drivers[current_driver.to_sym]
+      if backend.respond_to? :providers
+        backend.providers(@credentials)
+      else
+        Deltacloud.drivers[current_driver.to_sym]
+      end
+    end
+
+    def provider(opts={})
+      providers.find { |p| p.id == opts[:id] }
     end
 
     def method_missing(name, *args)
-- 
1.7.10.2


Mime
View raw message