Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B92495C1 for ; Thu, 7 Jun 2012 11:59:08 +0000 (UTC) Received: (qmail 71662 invoked by uid 500); 7 Jun 2012 11:59:08 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 71631 invoked by uid 500); 7 Jun 2012 11:59:08 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 71536 invoked by uid 99); 7 Jun 2012 11:59:05 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 11:59:05 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 97D2C109C3; Thu, 7 Jun 2012 11:59:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mfojtik@apache.org To: commits@deltacloud.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [2/4] git commit: Core: Prevent 'root_url' overriding by different frontends when they use Rabbit Message-Id: <20120607115905.97D2C109C3@tyr.zones.apache.org> Date: Thu, 7 Jun 2012 11:59:05 +0000 (UTC) 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 Authored: Thu Jun 7 13:05:50 2012 +0200 Committer: Michal fojtik 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)