ACK. 

-- 
Michal Fojtik
Senior Software Engineer, Red Hat Inc.
[email protected]


On Tuesday, March 6, 2012 at 5:22 PM, [email protected] wrote:

> From: marios <[email protected] (mailto:[email protected])>
> 
> 
> Signed-off-by: marios <[email protected] (mailto:[email protected])>
> ---
> server/lib/cimi/model/machine_configuration.rb | 13 ++++++++-----
> 1 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/server/lib/cimi/model/machine_configuration.rb 
> b/server/lib/cimi/model/machine_configuration.rb
> index feab4e8..07f5429 100644
> --- a/server/lib/cimi/model/machine_configuration.rb
> +++ b/server/lib/cimi/model/machine_configuration.rb
> @@ -51,14 +51,17 @@ class CIMI::Model::MachineConfiguration < 
> CIMI::Model::Base
> 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
> + memory = profile.memory.value || profile.memory.default
> + cpu = profile.cpu.value || profile.cpu.default
> + storage = profile.storage.value || profile.storage.default
> machine_hash = {
> :name => profile.name (http://profile.name),
> - :description => "Machine Configuration with #{profile.memory.value} 
> #{profile.memory.unit} "+
> - "of memory and #{profile.cpu.value} CPU",
> - :cpu => profile.cpu.value,
> + :description => "Machine Configuration with #{memory} 
> #{profile.memory.unit} "+
> + "of memory and #{cpu} CPU",
> + :cpu => cpu,
> :created => Time.now.to_s, # FIXME: DC hardware_profile has no mention about 
> created_at
> - :memory => { :quantity => profile.memory.value || profile.memory.default, 
> :units => profile.memory.unit },
> - :disks => [ { :capacity => { :quantity => profile.storage.value || 
> profile.storage.default, :units => profile.storage.unit } } ],
> + :memory => { :quantity => memory, :units => profile.memory.unit },
> + :disks => [ { :capacity => { :quantity => storage, :units => 
> profile.storage.unit } } ],
> :uri => context.machine_configuration_url(profile.name (http://profile.name))
> }
> self.new(machine_hash)
> -- 
> 1.7.6.5



Reply via email to