deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject [2/9] git commit: CIMI: added block to ensure config collection urls in CEP spell out configuration. Fix for query on DTACLOUD-577
Date Tue, 09 Jul 2013 06:25:08 GMT
CIMI: added block to ensure config collection urls in CEP
spell out configuration. Fix for query on DTACLOUD-577


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

Branch: refs/heads/master
Commit: 8249f4b1b43fc14aaa755718d72974dc0bee73d8
Parents: 7a22299
Author: marios <marios@redhat.com>
Authored: Wed Jul 3 10:54:20 2013 +0300
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Wed Jul 3 23:51:12 2013 +1000

----------------------------------------------------------------------
 server/lib/cimi/models/resource.rb | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8249f4b1/server/lib/cimi/models/resource.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/resource.rb b/server/lib/cimi/models/resource.rb
index 89021cb..ff08eb9 100644
--- a/server/lib/cimi/models/resource.rb
+++ b/server/lib/cimi/models/resource.rb
@@ -172,9 +172,14 @@ module CIMI
           next if self[n].nil?
           next if self[n].kind_of? Array
           if @select_attrs.empty? or @select_attrs.include?(n)
-            self[n].href = "#{self.base_id}/#{n}" if !self[n].href
-            self[n].id = "#{self.base_id}/#{n}" if !self[n].entries.empty?
-
+            if n.to_s =~ /config/
+              fixed_name = (n.to_s.singularize + "uration").pluralize
+              self[n].href = "#{self.base_id}/#{fixed_name}" if !self[n].href
+              self[n].id = "#{self.base_id}/#{fixed_name}" if !self[n].entries.empty?
+            else
+              self[n].href = "#{self.base_id}/#{n}" if !self[n].href
+              self[n].id = "#{self.base_id}/#{n}" if !self[n].entries.empty?
+            end
             self[n].href["cloudEntryPoint/"] = "" \
               if self[n].href and self[n].href.include? "cloudEntryPoint/"
             self[n].id["cloudEntryPoint/"] = "" \


Mime
View raw message