[sqlalchemy-20] The Connection.connect() method is considered legacy
Change-Id: I5eaf60426e10c15ac16800ce1962d6690ff80f92 Related-Bug: #2008227
This commit is contained in:
parent
c5882990f6
commit
9aef6c4e03
|
@ -60,7 +60,7 @@ def check_sanity(connection):
|
|||
insp = sa.engine.reflection.Inspector.from_engine(connection)
|
||||
if 'firewall_groups_v2' not in insp.get_table_names():
|
||||
return []
|
||||
session = sa.orm.Session(bind=connection.connect())
|
||||
session = sa.orm.Session(bind=connection)
|
||||
default_fwg = session.query(resources.FIREWALL_GROUP.name).filter(
|
||||
resources.FIREWALL_GROUP.name == const.DEFAULT_FWG).first()
|
||||
if default_fwg:
|
||||
|
|
|
@ -64,7 +64,7 @@ def get_duplicate_port_records_in_fwg_port_association(connection):
|
|||
insp = sa.engine.reflection.Inspector.from_engine(connection)
|
||||
if 'firewall_group_port_associations_v2' not in insp.get_table_names():
|
||||
return []
|
||||
session = sa.orm.Session(bind=connection.connect())
|
||||
session = sa.orm.Session(bind=connection)
|
||||
query = (session.query(fwg_port_association.c.port_id)
|
||||
.group_by(fwg_port_association.c.port_id)
|
||||
.having(sa.func.count() > 1)).all()
|
||||
|
|
Loading…
Reference in New Issue