On 06/10/10 15:04 +0200, [email protected] wrote: >From: Tomas Sedovic <[email protected]> > >The Hardware Profile API call may return only some of the properties we >expect. > >Such a behaviour resulted in an uncaught exception. This fix ignores the >missing properties, but doesn't crash on them.
ACK. Just keep in mind, that you need update deltacloud-client for this feature. -- Michal > >Requires deltacloud-client-0.0.9.8. >--- > src/app/models/hardware_profile.rb | 4 ++-- > src/config/environment.rb | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/src/app/models/hardware_profile.rb >b/src/app/models/hardware_profile.rb >index 91fa9fc..6d019cc 100644 >--- a/src/app/models/hardware_profile.rb >+++ b/src/app/models/hardware_profile.rb >@@ -79,13 +79,13 @@ class HardwareProfile < ActiveRecord::Base > end > > def add_properties(api_profile) >- self.memory = new_property(api_profile.memory) >+ self.memory = new_property(nil) > self.storage = new_property(api_profile.storage) > self.cpu = new_property(api_profile.cpu) > self.architecture = new_property(api_profile.architecture) > end > def new_property(prop) >- return nil unless prop.present? >+ return nil if prop.nil? > the_property = HardwareProfileProperty.new(:name => prop.name, > :kind => prop.kind.to_s, > :unit => prop.unit, >diff --git a/src/config/environment.rb b/src/config/environment.rb >index 069b08d..423f224 100644 >--- a/src/config/environment.rb >+++ b/src/config/environment.rb >@@ -43,7 +43,7 @@ Rails::Initializer.run do |config| > # config.gem "hpricot", :version => '0.6', :source => > "http://code.whytheluckystiff.net" > # config.gem "aws-s3", :lib => "aws/s3" > config.gem "authlogic" >- config.gem "deltacloud-client", :lib => "deltacloud", :version => ">= >0.0.9.6" >+ config.gem "deltacloud-client", :lib => "deltacloud", :version => ">= >0.0.9.8" > config.gem "haml" > config.gem "will_paginate" > config.gem "nokogiri", :version => ">= 1.4.0" >-- >1.7.2.3 > >_______________________________________________ >deltacloud-devel mailing list >[email protected] >https://fedorahosted.org/mailman/listinfo/deltacloud-devel -- -------------------------------------------------------- Michal Fojtik, [email protected] Deltacloud API: http://deltacloud.org -------------------------------------------------------- _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
