Stop patching the wrong db api

Re-fixes DB transactions
This commit is contained in:
Matt Dietz
2013-03-19 16:33:46 +00:00
parent 3261f6c73d
commit b8b9e3698f

View File

@@ -72,7 +72,7 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
def _initDBMaker(self):
# This needs to be called after _ENGINE is configured
db_api._MAKER = scoped_session(sessionmaker(
quantum_db_api._MAKER = scoped_session(sessionmaker(
bind=quantum_db_api._ENGINE, extension=ZopeTransactionExtension()))
def __init__(self):
@@ -327,7 +327,6 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
quantum/api/v2/attributes.py. All keys will be populated.
"""
LOG.info("create_network for tenant %s" % context.tenant_id)
with context.session.begin():
# Generate a uuid that we're going to hand to the backend and db
net_uuid = uuidutils.generate_uuid()
@@ -364,7 +363,6 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
"""
LOG.info("update_network %s for tenant %s" %
(id, context.tenant_id))
with context.session.begin():
net = db_api.network_find(context, id=id, scope=db_api.ONE)
if not net:
raise exceptions.NetworkNotFound(net_id=id)
@@ -732,7 +730,6 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
ip_version,
ip_address)
port["ip_addresses"].append(address)
context.session.add(address)
return self._make_ip_dict(address)
def update_ip_address(self, context, id, ip_address):