deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: EC2: Fixed incorrectly mapped root_url
Date Tue, 04 Sep 2012 20:34:19 GMT
Updated Branches:
  refs/heads/master 4425e40df -> e2e30170d


EC2: Fixed incorrectly mapped root_url

* EC2 frontend does not use Rabbit DSL but regular
  Sinatra::Base class. Seems like this class does
  preserve original Rack mapping in the root_url
  which cause double-mapping (/ec2/ec2).

* Note: This patch is just a hot-fix, we need to
  investigate Rack mounting.


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

Branch: refs/heads/master
Commit: e2e30170dc06d4f9183559d7ce57ae6a01387432
Parents: 4425e40
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Tue Sep 4 22:22:22 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue Sep 4 22:22:22 2012 +0200

----------------------------------------------------------------------
 server/lib/ec2/server.rb |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e2e30170/server/lib/ec2/server.rb
----------------------------------------------------------------------
diff --git a/server/lib/ec2/server.rb b/server/lib/ec2/server.rb
index 15b6000..a6c3089 100644
--- a/server/lib/ec2/server.rb
+++ b/server/lib/ec2/server.rb
@@ -38,13 +38,14 @@ module Deltacloud::EC2
     enable :xhtml
     enable :dump_errors
     enable :show_errors
-    enable :method_override
     disable :show_exceptions
 
-    set :version, Deltacloud[:ec2].version
-    set :root_url, Deltacloud[:ec2].root_url
+    set :config, Deltacloud[:ec2]
+    set :root_url, config.root_url
+    set :root_path, config.root_url
+    set :version, config.version
     set :root, File.join(File.dirname(__FILE__), '..', '..')
-    set :views, File.join(File.dirname(__FILE__), 'views')
+    set :public_folder, root + '/public'
 
     error Deltacloud::EC2::QueryParser::InvalidAction do
       status 400
@@ -55,7 +56,7 @@ module Deltacloud::EC2
       headers 'Server' => 'Apache-Deltacloud-EC2/' + settings.version
     end
 
-    get Deltacloud[:ec2].root_url do
+    get '/' do
       headers 'Connection' => 'close'
       unless params['Action']
         redirect settings.root_url, 301


Mime
View raw message