deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [3/9] git commit: CIMI: toplevel collections must have a resourceURI attr in XML
Date Fri, 09 Nov 2012 19:49:38 GMT
CIMI: toplevel collections must have a resourceURI attr in XML


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

Branch: refs/heads/master
Commit: 41932b25a3e8a9c433e5e88a4f35cd42037ae380
Parents: b02acbd
Author: David Lutterkort <lutter@redhat.com>
Authored: Thu Nov 8 16:42:54 2012 -0800
Committer: David Lutterkort <lutter@redhat.com>
Committed: Fri Nov 9 11:48:42 2012 -0800

----------------------------------------------------------------------
 server/lib/cimi/models/base.rb   |    1 +
 server/tests/cimi/spec_helper.rb |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/41932b25/server/lib/cimi/models/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/base.rb b/server/lib/cimi/models/base.rb
index 63b24ae..6a73cf6 100644
--- a/server/lib/cimi/models/base.rb
+++ b/server/lib/cimi/models/base.rb
@@ -235,6 +235,7 @@ class CIMI::Model::Resource
   def self.to_xml(model)
     xml = @schema.to_xml(model)
     xml["xmlns"] = CMWG_NAMESPACE
+    xml["resourceURI"] = resource_uri
     XmlSimple.xml_out(xml, :root_name => xml_tag_name)
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/41932b25/server/tests/cimi/spec_helper.rb
----------------------------------------------------------------------
diff --git a/server/tests/cimi/spec_helper.rb b/server/tests/cimi/spec_helper.rb
index e1f2ee4..e86eaee 100644
--- a/server/tests/cimi/spec_helper.rb
+++ b/server/tests/cimi/spec_helper.rb
@@ -32,6 +32,9 @@ def parse_xml(xml, opts = {})
 end
 
 class HashCmp
+
+  IGNORED_KEYS = [ "resourceURI" ]
+
   def initialize(exp, act)
     @exp = exp
     @act = act
@@ -77,7 +80,7 @@ class HashCmp
       unless (missing = exp.keys - act.keys).empty?
         error "Missing key(s) at /#{path.join("/")}: #{missing.inspect}"
       end
-      unless (excess = act.keys - exp.keys).empty?
+      unless (excess = act.keys - exp.keys - IGNORED_KEYS).empty?
         error "Excess key(s) at /#{path.join("/")}: #{excess.inspect}"
       end
       (exp.keys - missing - excess).each do |k|


Mime
View raw message