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 1/4] Typos in CIMI::Machine create (machineTemplate vs MachineTemplate when parsing)
Date Wed, 07 Dec 2011 10:09:40 GMT
On Dec 5, 2011, at 5:15 PM, marios@redhat.com wrote:

ACK. Good catch.

  -- Michal

> From: marios <marios@redhat.com>
> 
> 
> Signed-off-by: marios <marios@redhat.com>
> ---
> server/lib/cimi/model/machine.rb |   14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/server/lib/cimi/model/machine.rb b/server/lib/cimi/model/machine.rb
> index cff2dd5..54d9418 100644
> --- a/server/lib/cimi/model/machine.rb
> +++ b/server/lib/cimi/model/machine.rb
> @@ -70,16 +70,16 @@ 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
> +    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 })
>     from_instance(instance, context)
>   end
> 
>   def self.create_from_xml(body, context)
>     xml = XmlSimple.xml_in(body)
> -    hardware_profile_id = xml['MachineTemplate'][0]['MachineConfig'][0]["href"].split('/').last
> -    image_id = xml['MachineTemplate'][0]['MachineImage'][0]["href"].split('/').last
> +    hardware_profile_id = xml['machineTemplate'][0]['machineConfig'][0]["href"].split('/').last
> +    image_id = xml['machineTemplate'][0]['machineImage'][0]["href"].split('/').last
>     instance = context.driver.create_instance(context.credentials, image_id, { :hwp_id
=> hardware_profile_id })
>     from_instance(instance, context)
>   end
> @@ -145,11 +145,11 @@ class CIMI::Model::Machine < CIMI::Model::Base
>     machine_conf = MachineConfiguration.find(profile.name, context)
>     storage_override = profile.overrides.find { |p, v| p == :storage }
>     [
> -      { :capacity => { 
> +      { :capacity => {
>           :quantity => storage_override.nil? ? machine_conf.disks.first[:capacity][:quantity]
: storage_override[1],
>           :units => machine_conf.disks.first[:capacity][:units]
> -        } 
> -      } 
> +        }
> +      }
>     ]
>   end
> 
> -- 
> 1.7.6.4
> 

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org


Mime
View raw message