From: Michal Fojtik <[email protected]>
Signed-off-by: Michal fojtik <[email protected]> --- 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(-) 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 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" /> 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> 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"/> -- 1.8.0
