deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 3/3] CIMI - add mandatory 'format' to MachineConfiguration.disk ("unknown")
Date Mon, 12 Nov 2012 15:36:09 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/cimi/models/machine_configuration.rb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/server/lib/cimi/models/machine_configuration.rb b/server/lib/cimi/models/machine_configuration.rb
index 2ee4c5a..a3aab8c 100644
--- a/server/lib/cimi/models/machine_configuration.rb
+++ b/server/lib/cimi/models/machine_configuration.rb
@@ -42,7 +42,6 @@ class CIMI::Model::MachineConfiguration < CIMI::Model::Base
   end
 
   private
-
   def self.from_hardware_profile(profile, context)
     # We accept just profiles with all properties set
     return unless profile.memory or profile.cpu or profile.storage
@@ -56,7 +55,7 @@ class CIMI::Model::MachineConfiguration < CIMI::Model::Base
       :cpu => ( cpu if cpu ) ,
       :created => Time.now.xmlschema,  # FIXME: DC hardware_profile has no mention about
created_at
       :memory => (memory if memory),
-      :disks => (  [ { :capacity => storage  } ] if storage ),
+      :disks => (  [ { :capacity => storage, :format => (profile.storage.respond_to?(:format)
? profile.storage.format : "unknown")  } ] if storage ), #no format attr for hwp - may be
added if providers support...,
       :id => context.machine_configuration_url(profile.name)
     }
     self.new(machine_hash)
-- 
1.7.11.7


Mime
View raw message