deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH] Fix redirection to root_url/change drivers/provider via HTML UI
Date Mon, 11 Jun 2012 07:34:16 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/server.rb |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
index cdb7150..32acb38 100644
--- a/server/lib/deltacloud/server.rb
+++ b/server/lib/deltacloud/server.rb
@@ -44,7 +44,7 @@ module Deltacloud
 
     set :config, Deltacloud[:deltacloud]
 
-    get config.root_url + '/?' do
+    get Deltacloud.config[:deltacloud].root_url + '/?' do
       if params[:force_auth]
         return [401, 'Authentication failed'] unless driver.valid_credentials?(credentials)
       end
@@ -55,20 +55,20 @@ module Deltacloud
       end
     end
 
-    post config.root_url + '/?' do
+    post Deltacloud.config[:deltacloud].root_url + '/?' do
       param_driver, param_provider = params["driver"], params["provider"]
       if param_driver
-        redirect "#{config.root_url}\;driver=#{param_driver}", 301
+        redirect "#{Deltacloud.config[:deltacloud].root_url}\;driver=#{param_driver}", 301
       elsif param_provider && param_provider != "default"
 #FIXME NEEDS A BETTER WAY OF GRABBING CURRENT DRIVER FROM MATRIX PARAMS...
         current_matrix_driver = env["HTTP_REFERER"].match(/\;(driver)=(\w*).*$/i)
         if current_matrix_driver
-          redirect "#{config.root_url}\;driver=#{$2}\;provider=#{param_provider}", 301
+          redirect "#{Deltacloud.config[:deltacloud].root_url}\;driver=#{$2}\;provider=#{param_provider}",
301
         else
-          redirect "#{config.root_url}\;provider=#{param_provider}", 301
+          redirect "#{Deltacloud.config[:deltacloud].root_url}\;provider=#{param_provider}",
301
         end
       else
-        redirect "#{config.root_url}", 301
+        redirect "#{Deltacloud.config[:deltacloud].root_url}", 301
       end
     end
 
-- 
1.7.6.5


Mime
View raw message