incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r983024 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
Date Fri, 06 Aug 2010 15:28:48 GMT
Author: mfojtik
Date: Fri Aug  6 15:28:48 2010
New Revision: 983024

URL: http://svn.apache.org/viewvc?rev=983024&view=rev
Log:
Fix up rackspace driver to return instances from actions.

As with the EC2 and GoGrid drivers, make sure to return
at least a minimal instance object from the action methods.
This fixes up stack traces being generated after these
calls succeed.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb?rev=983024&r1=983023&r2=983024&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
(original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
Fri Aug  6 15:28:48 2010
@@ -73,6 +73,11 @@ class RackspaceDriver < Deltacloud::Base
     safely do
       racks.reboot_server(id)
     end
+    Instance.new( {
+      :id => id,
+      :state => "REBOOT",
+      :actions => instance_actions_for( state ),
+    } )
   end
 
   def stop_instance(credentials, id)
@@ -84,6 +89,11 @@ class RackspaceDriver < Deltacloud::Base
     safely do
       racks.delete_server(id)
     end
+    Instance.new( {
+      :id => id,
+      :state => "STOPPED",
+      :actions => instance_actions_for( "STOPPED" ),
+    } )
   end
 
 
@@ -123,7 +133,6 @@ class RackspaceDriver < Deltacloud::Base
 
 
   def convert_srv_to_instance(srv)
-    status = srv["status"] == "ACTIVE" ? "RUNNING" : "PENDING"
     inst = Instance.new(:id => srv["id"].to_s,
                         :owner_id => "root",
                         :realm_id => "us")



Mime
View raw message