deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 3/5] CIMI: Fixed format of capacity property, removed obsolete properties
Date Mon, 12 Nov 2012 11:34:55 GMT
From: Michal Fojtik <mfojtik@redhat.com>

* guestInterface, supportSnapshots removed
* capacity is now 1.0.1 compliant

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/cimi/models/volume_configuration.rb | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/server/lib/cimi/models/volume_configuration.rb b/server/lib/cimi/models/volume_configuration.rb
index dd9f068..fc89c6e 100644
--- a/server/lib/cimi/models/volume_configuration.rb
+++ b/server/lib/cimi/models/volume_configuration.rb
@@ -18,12 +18,9 @@ class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
   acts_as_root_entity :as => "volumeConfigs"
 
   text :format
-  struct :capacity do
-    scalar :quantity
-    scalar :units
-  end
-  text :supports_snapshots
-  text :guest_interface
+
+  text :capacity
+
   array :operations do
     scalar :rel, :href
   end
@@ -50,10 +47,10 @@ class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
   def self.create(size, context)
     self.new( {
                 :id => context.volume_configuration_url(size),
-                :name => size,
-                :description => "volume configuration with #{size} GiB",
+                :name => "volume-#{size}",
+                :description => "Volume configuration with #{size} kilobytes",
                 :created => Time.now.xmlschema,
-                :capacity => {:quantity=>size, :units=>"gibibytes"},
+                :capacity => size * 1024,
                 :supports_snapshots => "true"
                 # FIXME :guest_interface => "NFS"
             } )
-- 
1.8.0


Mime
View raw message