You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2011/12/13 15:24:36 UTC

[PATCH 2/3] Deal with volume not found for CIMI::Volume

From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 server/lib/cimi/server.rb |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/lib/cimi/server.rb b/server/lib/cimi/server.rb
index 77a8d04..2d62c44 100644
--- a/server/lib/cimi/server.rb
+++ b/server/lib/cimi/server.rb
@@ -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
-- 
1.7.6.4