ACK Regards, Dies Koper
> -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: Wednesday, 7 November 2012 7:22 PM > To: [email protected] > Subject: [PATCH 2/3] CIMI - fix json parsing for create Machine > > From: marios <[email protected]> > > > Signed-off-by: marios <[email protected]> > --- > 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 >
