Merge "Invoke _process_l3_create within plugin session"

This commit is contained in:
Jenkins 2014-04-01 11:47:19 +00:00 committed by Gerrit Code Review
commit b4b3c973a3
1 changed files with 12 additions and 10 deletions

View File

@ -185,17 +185,19 @@ class OneConvergencePluginV2(db_base_plugin_v2.NeutronDbPluginV2,
network['network']['id'] = net['id'] network['network']['id'] = net['id']
try: with context.session.begin(subtransactions=True):
neutron_net = super(OneConvergencePluginV2, try:
self).create_network(context, network) neutron_net = super(OneConvergencePluginV2,
self).create_network(context, network)
#following call checks whether the network is external or not and #following call checks whether the network is external or not
#if it is external then adds this network to externalnetworks #and if it is external then adds this network to
#table of neutron db #externalnetworks table of neutron db
self._process_l3_create(context, neutron_net, network['network']) self._process_l3_create(context, neutron_net,
except nvsdexception.NVSDAPIException: network['network'])
with excutils.save_and_reraise_exception(): except nvsdexception.NVSDAPIException:
self.nvsdlib.delete_network(net) with excutils.save_and_reraise_exception():
self.nvsdlib.delete_network(net)
return neutron_net return neutron_net