use retry_if_session_inactive from neutron-lib

The retry_if_session_inactive decorator was rehomed into neutron-lib
[1]. This patch consumes it by using neutron-libs version where
appropriate in prep for [2].

[1] https://review.openstack.org/#/c/557040/
[2] https://review.openstack.org/#/c/607710/

Change-Id: I32905d95fe216d6113ff6b82de17aae650d0d736
This commit is contained in:
Boden R 2018-10-05 06:07:22 -06:00
parent c2e38a3d28
commit 7bcac8c261
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import context as n_context
from neutron_lib.db import api as lib_db_api
from neutron_lib.db import utils as db_utils
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
@ -292,7 +293,7 @@ class NsxTVDPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
p = self._get_plugin_from_project(context, tenant_id)
return p.create_network(context, network)
@db_api.retry_if_session_inactive()
@lib_db_api.retry_if_session_inactive()
def create_network_bulk(self, context, networks):
#Implement create bulk so that the plugin calculation will be done once
objects = []