deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/4] git commit: Core: Prevent 'root_url' overriding by different frontends when they use Rabbit
Date Thu, 07 Jun 2012 11:59:05 GMT
Core: Prevent 'root_url' overriding by different frontends when they use Rabbit


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

Branch: refs/heads/master
Commit: fa24a9269dedab87a23c827475f5355c9bde17d3
Parents: fb2fda0
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Thu Jun 7 13:05:50 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Thu Jun 7 13:05:50 2012 +0200

----------------------------------------------------------------------
 server/lib/cimi/collections/cloud_entry_point.rb   |    4 +---
 server/lib/cimi/helpers.rb                         |   10 +++++++---
 server/lib/deltacloud/helpers.rb                   |    4 ++++
 server/lib/deltacloud/helpers/deltacloud_helper.rb |    8 --------
 4 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fa24a926/server/lib/cimi/collections/cloud_entry_point.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/cloud_entry_point.rb b/server/lib/cimi/collections/cloud_entry_point.rb
index f5f2233..5aa2630 100644
--- a/server/lib/cimi/collections/cloud_entry_point.rb
+++ b/server/lib/cimi/collections/cloud_entry_point.rb
@@ -16,9 +16,7 @@
 module CIMI::Collections
   class CloudEntryPoint < Base
 
-    check_capability :for => lambda { |m| driver.respond_to? m }
-
-    collection  :cloudEntryPoint do
+    collection :cloudEntryPoint do
       description 'Cloud entry point'
       operation :index do
         description "list all resources of the cloud"

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fa24a926/server/lib/cimi/helpers.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/helpers.rb b/server/lib/cimi/helpers.rb
index 1b91423..b645fbb 100644
--- a/server/lib/cimi/helpers.rb
+++ b/server/lib/cimi/helpers.rb
@@ -37,13 +37,13 @@ require_relative '../deltacloud/helpers/auth_helper'
 require_relative '../deltacloud/helpers/url_helper'
 require_relative '../deltacloud/helpers/deltacloud_helper'
 require_relative '../deltacloud/helpers/rabbit_helper'
-require_relative '../deltacloud/helpers/rabbit_helper'
 require_relative './helpers/cimi_helper'
 require_relative './models'
 
 module CIMI::Collections
   class Base < Sinatra::Base
 
+    include Sinatra::Rabbit
     extend Deltacloud::Helpers::Drivers
     include Sinatra::Rabbit::Features
     include CIMI::Model
@@ -62,12 +62,16 @@ module CIMI::Collections
     enable :show_errors
     disable :show_exceptions
 
-    set :root_url, Deltacloud[:cimi].root_url
-    set :version, Deltacloud[:cimi].version
+    set :config, Deltacloud[:cimi]
+    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, root + '/views/cimi'
     set :public_folder, root + '/public'
 
+    Sinatra::Rabbit.set :root_path, "#{config.root_url}/"
+
     error do
       report_error
     end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fa24a926/server/lib/deltacloud/helpers.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers.rb b/server/lib/deltacloud/helpers.rb
index 8d5774c..77d201e 100644
--- a/server/lib/deltacloud/helpers.rb
+++ b/server/lib/deltacloud/helpers.rb
@@ -23,6 +23,7 @@ require_relative 'helpers/blob_stream_helper'
 module Deltacloud::Collections
   class Base < Sinatra::Base
 
+    include Sinatra::Rabbit
     extend Deltacloud::Helpers::Drivers
     include Sinatra::Rabbit::Features
 
@@ -42,11 +43,14 @@ module Deltacloud::Collections
 
     set :config, Deltacloud[:deltacloud]
     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, root + '/views'
     set :public_folder, root + '/public'
 
+    Sinatra::Rabbit.set :root_path, "#{config.root_url}/"
+
     error do
       report_error
     end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fa24a926/server/lib/deltacloud/helpers/deltacloud_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb
index 843e45f..6d8cb9b 100644
--- a/server/lib/deltacloud/helpers/deltacloud_helper.rb
+++ b/server/lib/deltacloud/helpers/deltacloud_helper.rb
@@ -18,14 +18,6 @@ module Deltacloud::Helpers
 
     require 'benchmark'
 
-    def self.included(klass)
-      klass.class_eval do
-        set :config, Deltacloud[:deltacloud]
-        include Sinatra::Rabbit
-        Sinatra::Rabbit.set :root_path, "#{config.root_url}/"
-      end
-    end
-
     def auth_feature_name
       return 'key' if driver.class.has_feature?(:instances, :authentication_key)
       return 'password' if driver.class.has_feature?(:instances, :authentication_password)


Mime
View raw message