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 2012/11/19 12:23:55 UTC

[3/3] git commit: CIMI: Renamed 'name' attribute to 'key' in resource properties (DTACLOUD-372)

CIMI: Renamed 'name' attribute to 'key' in resource properties (DTACLOUD-372)


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

Branch: refs/heads/master
Commit: e522c5d411a705c9fafd7a2fb42737eb8b15e7b0
Parents: b5680d8
Author: Michal Fojtik <mf...@redhat.com>
Authored: Mon Nov 19 10:53:11 2012 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Mon Nov 19 10:53:11 2012 +0100

----------------------------------------------------------------------
 server/lib/cimi/models/schema.rb                 |    4 ++--
 server/tests/cimi/data/machine.xml               |    2 +-
 server/tests/cimi/data/machine_configuration.xml |    2 +-
 server/tests/cimi/data/machine_image.xml         |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e522c5d4/server/lib/cimi/models/schema.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/schema.rb b/server/lib/cimi/models/schema.rb
index 115e236..3d6a097 100644
--- a/server/lib/cimi/models/schema.rb
+++ b/server/lib/cimi/models/schema.rb
@@ -195,7 +195,7 @@ class CIMI::Model::Schema
 
     def from_xml(xml, model)
       model[name] = (xml[xml_name] || []).inject({}) do |result, item|
-        result[item["name"]] = item["content"]
+        result[item["key"]] = item["content"]
         result
       end
     end
@@ -205,7 +205,7 @@ class CIMI::Model::Schema
     end
 
     def to_xml(model, xml)
-      ary = (model[name] || {}).map { |k, v| { "name" => k, "content" => v } }
+      ary = (model[name] || {}).map { |k, v| { "key" => k, "content" => v } }
       xml[xml_name] = ary unless ary.empty?
     end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e522c5d4/server/tests/cimi/data/machine.xml
----------------------------------------------------------------------
diff --git a/server/tests/cimi/data/machine.xml b/server/tests/cimi/data/machine.xml
index f33c774..24239ff 100644
--- a/server/tests/cimi/data/machine.xml
+++ b/server/tests/cimi/data/machine.xml
@@ -3,7 +3,7 @@
   <name>machine1</name>
   <description>Machine one description</description>
   <created>2011-11-21</created>
-  <property name="owner_id">mockuser</property>
+  <property key="owner_id">mockuser</property>
   <cpu>4</cpu>
   <memory>12582912</memory>
   <disks href="http://cimi.example.org/cimi/machines/1/disks" />

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e522c5d4/server/tests/cimi/data/machine_configuration.xml
----------------------------------------------------------------------
diff --git a/server/tests/cimi/data/machine_configuration.xml b/server/tests/cimi/data/machine_configuration.xml
index 9f451a6..cad692d 100644
--- a/server/tests/cimi/data/machine_configuration.xml
+++ b/server/tests/cimi/data/machine_configuration.xml
@@ -3,7 +3,7 @@
   <name>MachineConfiguration1</name>
   <description>Example MachineConfiguration One</description>
   <created>2011-11-14</created>
-  <property name="architecture">i386</property>
+  <property key="architecture">i386</property>
   <cpu>2</cpu>
   <memory>1048576</memory>
   <disk>

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e522c5d4/server/tests/cimi/data/machine_image.xml
----------------------------------------------------------------------
diff --git a/server/tests/cimi/data/machine_image.xml b/server/tests/cimi/data/machine_image.xml
index 1f7b46c..e5b03cf 100644
--- a/server/tests/cimi/data/machine_image.xml
+++ b/server/tests/cimi/data/machine_image.xml
@@ -3,8 +3,8 @@
   <name>img1</name>
   <description>Machine Image One</description>
   <created>2011-11-14</created>
-  <property name="status">BUILD</property>
-  <property name="locked">true</property>
+  <property key="status">BUILD</property>
+  <property key="locked">true</property>
   <imageLocation href="nfs://cimi.example.com/images/1.img"/>
   <operation rel="edit" href="http://cimi.example.org/machine_images/1/edit"/>
   <operation rel="delete" href="http://cimi.example.org/machine_images/1/delete"/>