ack something i've been wondering about and not specific to this patch... do we want to make our requirements on the the xml/json clients send a little less rigid? I'm thinking its a little fragile right now - as is evident in this patch... its conceivable that client sends MachineTemplate vs machineTemplate... we could write a hash extension to do this ... but only if we think its 'ok' for the client to not follow the spec _exactly_... I'm not convinced it is...?
On 17/01/12 13:52, [email protected] wrote: > From: Michal Fojtik <[email protected]> > > > Signed-off-by: Michal fojtik <[email protected]> > --- > server/lib/cimi/model/machine.rb | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/server/lib/cimi/model/machine.rb > b/server/lib/cimi/model/machine.rb > index c55c4eb..949a072 100644 > --- a/server/lib/cimi/model/machine.rb > +++ b/server/lib/cimi/model/machine.rb > @@ -82,7 +82,7 @@ class CIMI::Model::Machine < CIMI::Model::Base > hardware_profile_id = > machine_template['machineConfig'][0]["href"].split('/').last > image_id = machine_template['machineImage'][0]["href"].split('/').last > additional_params = {} > - if machine_template.has_key? 'MachineAdmin' > + if machine_template.has_key? 'machineAdmin' > additional_params[:keyname] = > machine_template['machineAdmin'][0]["href"].split('/').last > end > instance = context.driver.create_instance(context.credentials, image_id, > { > @@ -212,7 +212,7 @@ class CIMI::Model::Machine < CIMI::Model::Base > > def self.convert_instance_actions(instance, context) > instance.actions.collect do |action| > - action = :delete if action == :destroy # In CIMI destroy operation > become delete > + action = :destroy if action == :delete # In CIMI destroy operation > become delete > action = :restart if action == :reboot # In CIMI reboot operation > become restart > { :href => context.send(:"#{action}_machine_url", instance.id), :rel > => "http://www.dmtf.org/cimi/action/#{action}" } > end
