You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/02/21 14:51:01 UTC

[3/5] git commit: Core: Raise error if the collection is already registred in Rabbit

Core: Raise error if the collection is already registred in Rabbit

This patch will make sure you don't have two duplicate collections
registred to Rabbit both for DC and CIMI.


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

Branch: refs/heads/master
Commit: 19babd48ee932515389b2324fe8f6e27ce381154
Parents: 5dacd89
Author: Michal Fojtik <mf...@redhat.com>
Authored: Thu Feb 21 13:41:40 2013 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Thu Feb 21 13:41:40 2013 +0100

----------------------------------------------------------------------
 server/lib/cimi/collections.rb       |    1 +
 server/lib/deltacloud/collections.rb |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/19babd48/server/lib/cimi/collections.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections.rb b/server/lib/cimi/collections.rb
index 67527fb..e0a93b5 100644
--- a/server/lib/cimi/collections.rb
+++ b/server/lib/cimi/collections.rb
@@ -44,6 +44,7 @@ module CIMI
       cimi_modules << cimi_module_class
       unless cimi_module_class.collections.nil?
         cimi_module_class.collections.each do |c|
+          raise "ERROR: CIMI collection #{c} already registred" if CIMI.collections.include? c
           CIMI.collections << c
         end
       else

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/19babd48/server/lib/deltacloud/collections.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections.rb b/server/lib/deltacloud/collections.rb
index df42cf1..d3517b8 100644
--- a/server/lib/deltacloud/collections.rb
+++ b/server/lib/deltacloud/collections.rb
@@ -43,6 +43,9 @@ module Deltacloud
       deltacloud_module_class = Deltacloud::Collections.const_get(base_collection_name.camelize)
       deltacloud_modules << deltacloud_module_class
       deltacloud_module_class.collections.each do |c|
+        if Deltacloud.collections.include? c
+          raise "ERROR: Deltacloud collection #{c} already registred"
+        end
         Deltacloud.collections << c
       end unless deltacloud_module_class.collections.nil?
     end