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] Fix Openstack 'stop' behaviour - wasn't setting state correctly
Date Tue, 25 Sep 2012 12:30:29 GMT
On Sep 25, 2012, at 11:21 AM, marios@redhat.com wrote:

ACK.

> 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
> 

Michal Fojtik
http://deltacloud.org
mfojtik@redhat.com




Mime
View raw message