You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2011/10/21 16:05:40 UTC

[PATCH core 2/3] CIMI: Replaced xmlns with CMWG_NAMESPACE constant

From: Michal Fojtik <mf...@redhat.com>


Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/lib/cimi/server.rb                          |    2 ++
 .../cimi/machine_configurations/index.xml.haml     |    2 +-
 .../cimi/machine_configurations/show.xml.haml      |    5 ++++-
 server/views/cimi/machine_images/index.xml.haml    |    2 +-
 server/views/cimi/machine_images/show.xml.haml     |    2 +-
 server/views/cimi/machines/index.xml.haml          |    2 +-
 server/views/cimi/machines/show.xml.haml           |    2 +-
 server/views/cimi/volumes/index.xml.haml           |    2 +-
 server/views/cimi/volumes/show.xml.haml            |    2 +-
 9 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/server/lib/cimi/server.rb b/server/lib/cimi/server.rb
index ecd4907..e933369 100644
--- a/server/lib/cimi/server.rb
+++ b/server/lib/cimi/server.rb
@@ -35,6 +35,8 @@ use Rack::DriverSelect
 use Rack::MediaType
 use Rack::Date
 
+helpers CMWG::Helper
+
 configure do
   set :root_url, "/cimi"
   set :views, File::join($top_srcdir, 'views', 'cimi')
diff --git a/server/views/cimi/machine_configurations/index.xml.haml b/server/views/cimi/machine_configurations/index.xml.haml
index ca1c312..f3b9b04 100644
--- a/server/views/cimi/machine_configurations/index.xml.haml
+++ b/server/views/cimi/machine_configurations/index.xml.haml
@@ -1,4 +1,4 @@
-%MachineConfigurationCollection{ :xmlns => "http://www.dmtf.org/cimi" }
+%MachineConfigurationCollection{ :xmlns => CMWG_NAMESPACE }
   %uri machineConfiguration
   - @resources.each do |resource|
     %machineConfiguration{ :href => resource[:href] }
diff --git a/server/views/cimi/machine_configurations/show.xml.haml b/server/views/cimi/machine_configurations/show.xml.haml
index dc00caa..3a2c13f 100644
--- a/server/views/cimi/machine_configurations/show.xml.haml
+++ b/server/views/cimi/machine_configurations/show.xml.haml
@@ -1,4 +1,4 @@
-%MachineConfiguration{ :xmlns => 'http://www.dmtf.org/cimi' }
+%MachineConfiguration{ :xmlns => CMWG_NAMESPACE }
   %uri machineConfiguration
   %name=@object.name
   %description FIXME: Machine description
@@ -8,6 +8,9 @@
   %disk
     %capacity{ :quantity => 200, :units => :gigabyte}
     %guestInterface SATA
+  %disk
+    %capacity{ :quantity => 100, :units => :gigabyte}
+    %guestInterface SATA
   %supportsSnapshots false
   %guestInterface http://www.ibm.com
   %operation{ :rel => :edit, :href => '/machine_configuration' }
diff --git a/server/views/cimi/machine_images/index.xml.haml b/server/views/cimi/machine_images/index.xml.haml
index 04ed206..37d0e1e 100644
--- a/server/views/cimi/machine_images/index.xml.haml
+++ b/server/views/cimi/machine_images/index.xml.haml
@@ -1,4 +1,4 @@
-%MachineImageCollection{ :xmlns => "http://www.dmtf.org/cimi" }
+%MachineImageCollection{ :xmlns => CMWG_NAMESPACE }
   %uri machineImage
   - @resources.each do |resource|
     %machineImage{ :href => resource[:href] }
diff --git a/server/views/cimi/machine_images/show.xml.haml b/server/views/cimi/machine_images/show.xml.haml
index c92b838..846bcfc 100644
--- a/server/views/cimi/machine_images/show.xml.haml
+++ b/server/views/cimi/machine_images/show.xml.haml
@@ -1,4 +1,4 @@
-%MachineImage{ :xmlns => 'http://www.dmtf.org/cimi' }
+%MachineImage{ :xmlns => CMWG_NAMESPACE }
   %uri machineImage
   %name=@object.id
   %description=@object.name
diff --git a/server/views/cimi/machines/index.xml.haml b/server/views/cimi/machines/index.xml.haml
index 3b941f0..eac7368 100644
--- a/server/views/cimi/machines/index.xml.haml
+++ b/server/views/cimi/machines/index.xml.haml
@@ -1,4 +1,4 @@
-%MachineCollection{ :xmlns => "http://www.dmtf.org/cimi" }
+%MachineCollection{ :xmlns => CMWG_NAMESPACE }
   %uri machine
   - @resources.each do |resource|
     %machine{ :href => resource[:href] }
diff --git a/server/views/cimi/machines/show.xml.haml b/server/views/cimi/machines/show.xml.haml
index fa91066..0697774 100644
--- a/server/views/cimi/machines/show.xml.haml
+++ b/server/views/cimi/machines/show.xml.haml
@@ -1,4 +1,4 @@
-%Machine{ :xmlns => "http://www.dmtf.org/cimi" }
+%Machine{ :xmlns => CMWG_NAMESPACE }
   %uri machine
   %name=@object.id
   %description=@object.name
diff --git a/server/views/cimi/volumes/index.xml.haml b/server/views/cimi/volumes/index.xml.haml
index 9b91bf5..3706e36 100644
--- a/server/views/cimi/volumes/index.xml.haml
+++ b/server/views/cimi/volumes/index.xml.haml
@@ -1,4 +1,4 @@
-%VolumeCollection{ :xmlns => "http://www.dmtf.org/cimi" }
+%VolumeCollection{ :xmlns => CMWG_NAMESPACE }
   %uri volume
   - @resources.each do |resource|
     %volume{ :href => resource[:href] }
diff --git a/server/views/cimi/volumes/show.xml.haml b/server/views/cimi/volumes/show.xml.haml
index c68f4c0..a57323f 100644
--- a/server/views/cimi/volumes/show.xml.haml
+++ b/server/views/cimi/volumes/show.xml.haml
@@ -1,4 +1,4 @@
-%Volume{ :xmlns => "http://www.dmtf.org/cimi" }
+%Volume{ :xmlns => CMWG_NAMESPACE }
   %uri volume
   %name=@object.id
   %description FIXME: Description
-- 
1.7.4.4