deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koper, Dies" <di...@fast.au.fujitsu.com>
Subject RE: [PATCH 2/3] CIMI - fix json parsing for create Machine
Date Wed, 07 Nov 2012 08:30:48 GMT
ACK

Regards,
Dies Koper


> -----Original Message-----
> From: marios@redhat.com [mailto:marios@redhat.com]
> Sent: Wednesday, 7 November 2012 7:22 PM
> To: dev@deltacloud.apache.org
> Subject: [PATCH 2/3] CIMI - fix json parsing for create Machine
> 
> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
>  server/lib/cimi/models/machine.rb | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/server/lib/cimi/models/machine.rb
> b/server/lib/cimi/models/machine.rb
> index 6758d4a..53dc6a9 100644
> --- a/server/lib/cimi/models/machine.rb
> +++ b/server/lib/cimi/models/machine.rb
> @@ -49,9 +49,9 @@ class CIMI::Model::Machine < CIMI::Model::Base
> 
>    def self.create_from_json(body, context)
>      json = JSON.parse(body)
> -    hardware_profile_id =
> xml['machineTemplate']['machineConfig']["href"].split('/').last
> -    image_id =
xml['machineTemplate']['machineImage']["href"].split('/').last
> -    instance = context.create_instance(context.credentials, image_id,
{ :hwp_id
> => hardware_profile_id })
> +    hardware_profile_id =
> json['machineTemplate']['machineConfig']["href"].split('/').last
> +    image_id =
json['machineTemplate']['machineImage']["href"].split('/').last
> +    instance = context.driver.create_instance(context.credentials,
image_id,
> { :hwp_id => hardware_profile_id })
>      from_instance(instance, context)
>    end
> 
> --
> 1.7.11.7
> 



Mime
View raw message