nova-net: Remove now unnecessary nova-net workaround

We removed the comment for this workaround in change
Ifa9c5c468400261a5e1f66b72c575845173a4f8f but failed to remove the
workaround itself. Resolve this now.

Change-Id: I0a5b17f5b38ae3c2877fd8ea496047f8e56f3358
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane
2020-01-14 14:13:34 +00:00
parent 5dbab6e9d7
commit 8e5adb231f

View File

@@ -64,7 +64,6 @@ from nova.network import model as network_model
from nova.network import neutron
from nova.network import security_group_api
from nova import objects
from nova.objects import base as obj_base
from nova.objects import block_device as block_device_obj
from nova.objects import external_event as external_event_obj
from nova.objects import fields as fields_obj
@@ -2388,17 +2387,7 @@ class API(base.Base):
delete_type if delete_type != 'soft_delete' else 'delete'):
elevated = context.elevated()
orig_host = instance.host
try:
if instance.vm_state == vm_states.SHELVED_OFFLOADED:
sysmeta = getattr(instance,
obj_base.get_attrname(
'system_metadata'))
instance.host = sysmeta.get('shelved_host')
self.network_api.deallocate_for_instance(elevated,
instance)
finally:
instance.host = orig_host
self.network_api.deallocate_for_instance(elevated, instance)
# cleanup volumes
self._local_cleanup_bdm_volumes(bdms, instance, context)