incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r962329 - /incubator/deltacloud/trunk/server/server.rb
Date Thu, 08 Jul 2010 23:46:42 GMT
Author: lutter
Date: Thu Jul  8 23:46:41 2010
New Revision: 962329

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
--- 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
          redirect instance_url(params[:id])

View raw message