incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/3] Fixed client to use new relative URLs in HATEOAS
Date Mon, 21 Feb 2011 14:50:12 GMT
From: Michal Fojtik <mfojtik@redhat.com>

---
 client/lib/deltacloud.rb |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/client/lib/deltacloud.rb b/client/lib/deltacloud.rb
index de747e9..6d00af8 100644
--- a/client/lib/deltacloud.rb
+++ b/client/lib/deltacloud.rb
@@ -75,6 +75,8 @@ module DeltaCloud
       @api_driver, @api_provider = opts[:driver], opts[:provider]
       @username, @password = opts[:username] || user_name, opts[:password] || password
       @api_uri = URI.parse(api_url)
+      @api_path = @api_uri.path
+      @api_uri = URI.parse("#{@api_uri.scheme}://#{@api_uri.host}:#{@api_uri.port}")
       @features, @entry_points = {}, {}
       @verbose = opts[:verbose] || false
       discover_entry_points
@@ -124,7 +126,7 @@ module DeltaCloud
     def api_port; @api_uri.port ; end
 
     # Return API path
-    def api_path; @api_uri.path ; end
+    def api_path; @api_path ; end
 
     # Define methods based on 'rel' attribute in entry point
     # Two methods are declared: 'images' and 'image'
@@ -319,6 +321,7 @@ module DeltaCloud
         :timeout => args[4] || 45,
         :open_timeout => args[5] || 10
       }
+
       if conf[:query_args] != {}
         conf[:path] += '?' + URI.escape(conf[:query_args].collect{ |key, value| "#{key}=#{value}"
}.join('&')).to_s
       end
-- 
1.7.4


Mime
View raw message