You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2012/01/03 10:39:47 UTC

svn commit: r1226718 - /deltacloud/trunk/server/lib/cimi/model/machine.rb

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