From 5ba0fc1546d99d7f2ca9cb9877538e5a9aa857db Mon Sep 17 00:00:00 2001 From: Jerry Cai Date: Fri, 10 Oct 2014 16:23:12 +0800 Subject: [PATCH] Error occurred while removing instance due to neutron api updated This is a community nova change in: nova/network/neutronv2/api.py. https://github.com/openstack/nova/commit/ 65a4a6b0085f8639de2df2ccb5a17a5449d676ae Need driver to change to db object to nova object before call the api Change-Id: Ia783eec434f9d167b3386e5fa58496e952dbc7b4 Closes-Bug: 1379691 --- nova-powervc/powervc/nova/driver/compute/manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nova-powervc/powervc/nova/driver/compute/manager.py b/nova-powervc/powervc/nova/driver/compute/manager.py index a1cfeae..66d5c82 100644 --- a/nova-powervc/powervc/nova/driver/compute/manager.py +++ b/nova-powervc/powervc/nova/driver/compute/manager.py @@ -31,6 +31,7 @@ from nova.openstack.common import timeutils from nova.openstack.common import loopingcall from nova.openstack.common.loopingcall import LoopingCallDone from nova.openstack.common import jsonutils +from nova import objects from nova.objects import instance as instance_obj from nova.objects import base as obj_base from powervc.nova.driver.compute import computes @@ -628,6 +629,13 @@ class PowerVCCloudManager(manager.Manager): local_instance.get('name')) # delete network resource + # transfer db object to nova instance obj to meet latest community + # change + if not isinstance(local_instance, obj_base.NovaObject): + local_instance = \ + objects.Instance._from_db_object(ctx, + objects.Instance(), + local_instance) self.network_api.deallocate_for_instance(ctx, local_instance) # Send notification about instance deletion due to sync operation