deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: EC2: Mount the EC2 frontend on /ec2 instead of /
Date Mon, 03 Sep 2012 10:47:34 GMT
Updated Branches:
  refs/heads/master 1e0d9d339 -> 4e0b2120e


EC2: Mount the EC2 frontend on /ec2 instead of /

* This will make '/' URI free for use.


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

Branch: refs/heads/master
Commit: 4e0b2120ef6679f0e126ba08a3b3f380ca7425c4
Parents: 1e0d9d3
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Fri Aug 31 10:26:43 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Sep 3 12:47:54 2012 +0200

----------------------------------------------------------------------
 server/config.ru                |    2 +-
 server/lib/ec2/server.rb        |    2 +-
 server/tests/ec2/common.rb      |    4 +---
 server/tests/ec2/server_test.rb |    3 ++-
 4 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/4e0b2120/server/config.ru
----------------------------------------------------------------------
diff --git a/server/config.ru b/server/config.ru
index 0fc58e7..b1ce2a8 100644
--- a/server/config.ru
+++ b/server/config.ru
@@ -39,7 +39,7 @@ Deltacloud::configure(:cimi) do |server|
 end
 
 Deltacloud::configure(:ec2) do |server|
-  server.root_url '/'
+  server.root_url '/ec2'
   server.version '2012-04-01'
   server.klass 'Deltacloud::EC2::API'
   server.logger Rack::DeltacloudLogger.setup(ENV['API_LOG'], ENV['API_VERBOSE'])

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/4e0b2120/server/lib/ec2/server.rb
----------------------------------------------------------------------
diff --git a/server/lib/ec2/server.rb b/server/lib/ec2/server.rb
index 1e9e23a..15b6000 100644
--- a/server/lib/ec2/server.rb
+++ b/server/lib/ec2/server.rb
@@ -55,7 +55,7 @@ module Deltacloud::EC2
       headers 'Server' => 'Apache-Deltacloud-EC2/' + settings.version
     end
 
-    get '/' do
+    get Deltacloud[:ec2].root_url do
       headers 'Connection' => 'close'
       unless params['Action']
         redirect settings.root_url, 301

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/4e0b2120/server/tests/ec2/common.rb
----------------------------------------------------------------------
diff --git a/server/tests/ec2/common.rb b/server/tests/ec2/common.rb
index fabe5b7..727cd99 100644
--- a/server/tests/ec2/common.rb
+++ b/server/tests/ec2/common.rb
@@ -9,15 +9,13 @@ require_relative '../test_helper.rb'
 #
 
 Deltacloud::configure(:ec2) do |server|
-  server.root_url '/'
+  server.root_url '/ec2'
   server.version '2012-04-01'
   server.klass 'Deltacloud::EC2::API'
   server.logger Rack::DeltacloudLogger.setup(ENV['API_LOG'], ENV['API_VERBOSE'])
   server.default_driver :mock
 end
 
-Deltacloud.require_frontend! :ec2
-
 Deltacloud[:ec2].require!
 Deltacloud[:ec2].default_frontend!
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/4e0b2120/server/tests/ec2/server_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/ec2/server_test.rb b/server/tests/ec2/server_test.rb
index feca68e..dc07e14 100644
--- a/server/tests/ec2/server_test.rb
+++ b/server/tests/ec2/server_test.rb
@@ -17,7 +17,8 @@ describe Deltacloud::EC2::API do
   it 'must do a redirection when no Action parameter' do
     get root_url
     status.must_equal 301
-    headers['Location'].must_equal 'http://example.org/'
+    headers['Location'].wont_be_empty
+    headers['Location'].must_equal 'http://example.org' + root_url
   end
 
   it 'must set the Connection header to close' do


Mime
View raw message