deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 11/16] Core: Check if instance used to create new image exists correctly
Date Thu, 19 Jul 2012 13:02:44 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/collections/images.rb |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/collections/images.rb b/server/lib/deltacloud/collections/images.rb
index 2bb836e..6c4583d 100644
--- a/server/lib/deltacloud/collections/images.rb
+++ b/server/lib/deltacloud/collections/images.rb
@@ -22,8 +22,8 @@ module Deltacloud::Collections
     set :capability, lambda { |m| driver.respond_to? m }
 
     new_route_for :images do
-      @instance = Instance.new( :id => params[:instance_id] )
-      status 404 unless @instance
+      @instance = driver.instance(credentials, :id => params[:instance_id]) if params[:instance_id]
+      halt 404 unless @instance
     end
 
     collection :images do
-- 
1.7.10.2


Mime
View raw message