You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/07/09 01:46:42 UTC

svn commit: r962329 - /incubator/deltacloud/trunk/server/server.rb

Author: lutter
Date: Thu Jul  8 23:46:41 2010
New Revision: 962329

URL: http://svn.apache.org/viewvc?rev=962329&view=rev
Log:
Minor fix for server.rb - affects html case and those drivers where instance 'stop' equivalent to 'destroy'

This is a minor fix in server.rb that affects only those drivers where stopping an instance also means destroying it and where html is the requested output. Basically, in the rackspace case once you stop an instance this gets destroyed *very* quickly. In server.rb and when html is required, all instance actions except destroy cause the driver to request the details of that instance; that is, when you 'reboot' or 'start' you get the details of that specific instance, rather than the index. When you destroy, you dont request details as the instance no longer exists and you automatically get the index.

 However server.rb was not catching the 'stop' case and so when stop actually means destroy, you end up requesting details for an instance you already killed. This problem has only manifested itself in rackspace since they seem to get rid of their instances very quickly (e.g. in other cases like terremark, you might request the instance after you destroy it, and still get it for some time period).

Modified:
    incubator/deltacloud/trunk/server/server.rb

Modified: incubator/deltacloud/trunk/server/server.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/server.rb?rev=962329&r1=962328&r2=962329&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/server.rb (original)
+++ incubator/deltacloud/trunk/server/server.rb Thu Jul  8 23:46:41 2010
@@ -193,7 +193,7 @@ get "/api/instances/:id/:action" do
    respond_to do |format|
      format.html do
        driver.send(meth, credentials, params[:id])
-       if params[:action] == 'destroy'
+	if ( (params[:action] == 'destroy') or (params[:action] == 'stop') )
          redirect instances_url
        else
          redirect instance_url(params[:id])