deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1226718 - /deltacloud/trunk/server/lib/cimi/model/machine.rb
Date Tue, 03 Jan 2012 09:39:47 GMT
Author: marios
Date: Tue Jan  3 09:39:47 2012
New Revision: 1226718

URL: http://svn.apache.org/viewvc?rev=1226718&view=rev
Log:
CIMI deal with nilpointers in convert storage volumes (+swap volume=>device)

Modified:
    deltacloud/trunk/server/lib/cimi/model/machine.rb

Modified: deltacloud/trunk/server/lib/cimi/model/machine.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/machine.rb?rev=1226718&r1=1226717&r2=1226718&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/machine.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model/machine.rb Tue Jan  3 09:39:47 2012
@@ -219,8 +219,9 @@ class CIMI::Model::Machine < CIMI::Model
   end
 
   def self.convert_storage_volumes(instance, context)
-    instance.storage_volumes.map{|vol| {:href=>context.volume_url(vol.values.first),
-                                       :attachment_point=>vol.keys.first} }
+    instance.storage_volumes ||= [] #deal with nilpointers
+    instance.storage_volumes.map{|vol| {:href=>context.volume_url(vol.keys.first),
+                                       :attachment_point=>vol.values.first} }
   end
 
 end



Mime
View raw message