deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1214356 - /deltacloud/trunk/server/lib/cimi/server.rb
Date Wed, 14 Dec 2011 17:23:46 GMT
Author: marios
Date: Wed Dec 14 17:23:45 2011
New Revision: 1214356

URL: http://svn.apache.org/viewvc?rev=1214356&view=rev
Log:
Deal with volume not found for CIMI::Volume

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

Modified: deltacloud/trunk/server/lib/cimi/server.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/server.rb?rev=1214356&r1=1214355&r2=1214356&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/server.rb (original)
+++ deltacloud/trunk/server/lib/cimi/server.rb Wed Dec 14 17:23:45 2011
@@ -331,9 +331,13 @@ global_collection :volumes do
     param :id, :string, :required
     control do
       volume = Volume.find(params[:id], self)
-      respond_to do |format|
-        format.xml  { volume.to_xml  }
-        format.json { volume.to_json }
+      if volume
+        respond_to do |format|
+          format.xml  { volume.to_xml  }
+          format.json { volume.to_json }
+        end
+      else
+        report_error(404)
       end
     end
   end



Mime
View raw message