deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/4] CIMI: CloudEntryPoint now generate its schema before create
Date Fri, 02 Dec 2011 13:34:41 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/cimi/model/base.rb              |    3 +++
 server/lib/cimi/model/cloud_entry_point.rb |    1 -
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/server/lib/cimi/model/base.rb b/server/lib/cimi/model/base.rb
index f8ee983..fe12628 100644
--- a/server/lib/cimi/model/base.rb
+++ b/server/lib/cimi/model/base.rb
@@ -80,6 +80,9 @@ module CIMI::Model
   def self.register_as_root_entity!(name)
     @root_entities ||= []
     @root_entities << name
+    unless CIMI::Model::CloudEntryPoint.href_defined?(name)
+      CIMI::Model::CloudEntryPoint.send(:href, name.underscore)
+    end
   end
 
   def self.root_entities
diff --git a/server/lib/cimi/model/cloud_entry_point.rb b/server/lib/cimi/model/cloud_entry_point.rb
index edbcf0e..62a91b6 100644
--- a/server/lib/cimi/model/cloud_entry_point.rb
+++ b/server/lib/cimi/model/cloud_entry_point.rb
@@ -17,7 +17,6 @@ class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
 
   def self.create(context)
     root_entities = CIMI::Model.root_entities.inject({}) do |result, entity|
-      send(:href, entity.underscore) if not href_defined?(entity)
       if context.respond_to? :"#{entity.underscore}_url"
         result[entity.underscore] = { :href => context.send(:"#{entity.underscore}_url")
}
       end
-- 
1.7.4.4


Mime
View raw message