deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH] Fix Openstack 'stop' behaviour - wasn't setting state correctly
Date Tue, 25 Sep 2012 09:21:20 GMT
From: marios <marios@redhat.com>

thanks to Jan Provaznik

Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/drivers/openstack/openstack_driver.rb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
index 7e11258..1d5b712 100644
--- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
+++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
@@ -192,8 +192,12 @@ module Deltacloud
           os = new_client(credentials)
           safely do
             server = os.get_server(instance_id)
-            server.delete!
-            convert_from_server(server, os.connection.authuser)
+            deleted = server.delete!
+            instance = convert_from_server(server, os.connection.authuser)
+            if deleted
+              instance.state = "STOPPED"
+            end
+            instance
           end
         end
 
-- 
1.7.11.4


Mime
View raw message