deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 3/5] Core: Make 'features' optional for driver
Date Wed, 23 Nov 2011 16:23:23 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/sinatra/rabbit.rb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/lib/sinatra/rabbit.rb b/server/lib/sinatra/rabbit.rb
index 5c63fd9..21f0645 100644
--- a/server/lib/sinatra/rabbit.rb
+++ b/server/lib/sinatra/rabbit.rb
@@ -168,9 +168,9 @@ module Sinatra
       # operation plus the params defined by any features in the +driver+
       # that might modify this operation
       def effective_params(driver)
-        driver.features(@collection.name).collect do |f|
+        (driver.respond_to?(:features) ? driver.features(@collection.name).collect do |f|
           f.decl.operation(@name)
-        end.flatten.select { |op| op }.inject(params.dup) do |result, fop|
+        end : []).flatten.select { |op| op }.inject(params.dup) do |result, fop|
           fop.params.each_key do |k|
             if result.has_key?(k)
               raise DuplicateParamException, "Parameter '#{k}' for operation #{fop.name}
in collection #{@collection.name}"
-- 
1.7.4.4


Mime
View raw message