Cleaned up get_session

It's remnant of enginefacade migration that seems to be unused in the
tree and deprecated since Ocata.

Depends-On: Idb08f9bd1b0b9a97915fb9099c2c66ae0d847a94
Depends-On: I676c421adc0b3bd8c47629cf8768cf86fd92b7ab
Depends-On: I8b14dbcea341755a5c2b02b35b809d6b364de4c7
Change-Id: I71c3f09475675bbbd28c72cea50b5c1c67b8ae30
This commit is contained in:
Ihar Hrachyshka 2017-12-19 11:46:00 -08:00
parent b6f8a0562f
commit 5cb3e50b0b
1 changed files with 0 additions and 13 deletions

View File

@ -17,7 +17,6 @@ import contextlib
import copy
import weakref
from debtcollector import removals
from neutron_lib.db import api
from neutron_lib import exceptions
from neutron_lib.objects import exceptions as obj_exc
@ -186,18 +185,6 @@ def exc_to_retry(etypes):
raise db_exc.RetryRequest(e)
#TODO(akamyshnikova): when all places in the code, which use sessions/
# connections will be updated, this won't be needed
@removals.remove(version='Ocata', removal_version='Pike',
message="Usage of legacy facade is deprecated. Use "
"get_reader_session or get_writer_session instead.")
def get_session(autocommit=True, expire_on_commit=False, use_slave=False):
"""Helper method to grab session."""
return context_manager.get_legacy_facade().get_session(
autocommit=autocommit, expire_on_commit=expire_on_commit,
use_slave=use_slave)
def get_reader_session():
"""Helper to get reader session"""
return context_manager.reader.get_sessionmaker()()