deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [5/11] git commit: Core: Fixed url_for helper when used different frontend
Date Tue, 07 Aug 2012 17:17:48 GMT
Core: Fixed url_for helper when used different frontend

* url_for by default check the ENV and then fallback to Deltacloud
  This patch makes it look into Sinatra 'settings' for the correct
  root_url


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

Branch: refs/heads/master
Commit: 35970fe21dc36a3d00b7335723f5515be3ffe4b4
Parents: 7a64409
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Tue Jul 31 14:29:08 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue Aug 7 19:14:02 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/helpers/url_helper.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/35970fe2/server/lib/deltacloud/helpers/url_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/url_helper.rb b/server/lib/deltacloud/helpers/url_helper.rb
index 1822057..bf82867 100644
--- a/server/lib/deltacloud/helpers/url_helper.rb
+++ b/server/lib/deltacloud/helpers/url_helper.rb
@@ -96,7 +96,7 @@ module Sinatra
         else
           port = ":#{port}"
         end
-        base = "#{scheme}://#{request_host}#{port}#{request.script_name.empty? ? Deltacloud[ENV['API_FRONTEND']
|| :deltacloud].root_url : request.script_name}"
+        base = "#{scheme}://#{request_host}#{port}#{request.script_name.empty? ? settings.config.root_url
: request.script_name}"
       else
         raise TypeError, "Unknown url_for mode #{mode}"
       end


Mime
View raw message