deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH 2/2] CIMI: fix issue with (mock driver) opaque hardware_profile conversion
Date Wed, 07 Mar 2012 11:30:45 GMT
ACK.


Michal Fojtik
http://deltacloud.org
mfojtik@redhat.com



On Mar 7, 2012, at 12:27 PM, marios@redhat.com wrote:

> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
> server/lib/cimi/model/machine.rb |    7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/server/lib/cimi/model/machine.rb b/server/lib/cimi/model/machine.rb
> index 88c9f73..2e31065 100644
> --- a/server/lib/cimi/model/machine.rb
> +++ b/server/lib/cimi/model/machine.rb
> @@ -136,15 +136,16 @@ class CIMI::Model::Machine < CIMI::Model::Base
>   private
> 
>   def self.from_instance(instance, context)
> +    cpu =  memory = disks = (instance.instance_profile.id == "opaque")? "n/a" : nil
>     self.new(
>       :name => instance.id,
>       :description => instance.name,
>       :created => instance.launch_time,
>       :uri => context.machine_url(instance.id),
>       :state => convert_instance_state(instance.state),
> -      :cpu => convert_instance_cpu(instance.instance_profile, context),
> -      :memory => convert_instance_memory(instance.instance_profile, context),
> -      :disks => convert_instance_storage(instance.instance_profile, context),
> +      :cpu => cpu || convert_instance_cpu(instance.instance_profile, context),
> +      :memory => memory || convert_instance_memory(instance.instance_profile, context),
> +      :disks => disks || convert_instance_storage(instance.instance_profile, context),
>       :network_interfaces => convert_instance_addresses(instance),
>       :operations => convert_instance_actions(instance, context),
>       :volumes=>convert_storage_volumes(instance, context),
> -- 
> 1.7.6.5
> 


Mime
View raw message