incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH 05/10] Fix up rackspace driver to return instances from actions.
Date Fri, 06 Aug 2010 09:53:16 GMT
On 05/08/10 15:57 -0400, Chris Lalancette wrote:
>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")

ACK.


-- 
--------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com, +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API: http://deltacloud.org
--------------------------------------------------------

Mime
View raw message