You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/07/19 15:02:37 UTC

[PATCH core 04/16] Core: The 'supported_collections' helper now return correct array

From: Michal Fojtik <mf...@redhat.com>


Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/lib/deltacloud/helpers/deltacloud_helper.rb |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb
index cec22ac..047e1b2 100644
--- a/server/lib/deltacloud/helpers/deltacloud_helper.rb
+++ b/server/lib/deltacloud/helpers/deltacloud_helper.rb
@@ -19,6 +19,7 @@ module Deltacloud::Helpers
     require 'benchmark'
 
     def supported_collections
+      collection_arr = []
       Deltacloud::Collections.deltacloud_modules.each do |m|
         m.collections.each do |c|
           # Get the required capability for the :index operation (like 'realms' or 'instance_state_machine')
@@ -27,8 +28,10 @@ module Deltacloud::Helpers
           # for the Sinatra::Base class evaluate to 'true'
           next if m.settings.respond_to?(:capability) and !m.settings.capability(index_operation_capability)
           yield c if block_given?
+          collection_arr << c
         end
       end
+      collection_arr
     end
 
     def auth_feature_name
-- 
1.7.10.2