incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lalancette <clala...@redhat.com>
Subject [PATCH 05/10] Fix up rackspace driver to return instances from actions.
Date Thu, 05 Aug 2010 19:57:19 GMT
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>
---
 .../drivers/rackspace/rackspace_driver.rb          |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
index 0dc1733..6d6ba0b 100644
--- a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
+++ b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
@@ -73,6 +73,11 @@ class RackspaceDriver < Deltacloud::BaseDriver
     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::BaseDriver
     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::BaseDriver
 
 
   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")
-- 
1.7.2


Mime
View raw message