SQLAlchemy 2.0: Drop use of removed autoload

The autoload arugment was removed[1] in SQLAlchemy and only
the autoload_with argument should be passed.

The autoload argument is set according to the autoload_with argument
automatically even in SQLAlchemy 1.x[2] so is not at all needed.

[1] c932123bac
[2] ad8f921e96

Change-Id: I58d33c109a9479462dea80efc1d8bc6e1f8e954c
This commit is contained in:
Takashi Kajinami 2024-04-15 18:08:08 +09:00
parent 1fcd4a4a8f
commit 1328cb48e0
1 changed files with 2 additions and 2 deletions

View File

@ -90,9 +90,9 @@ def _make_endpoint_groups(new_groups, new_endpoints):
"""Create endpoint groups and their corresponding endpoints."""
md = sa.MetaData()
engine = op.get_bind()
sa.Table('vpn_endpoint_groups', md, autoload=True, autoload_with=engine)
sa.Table('vpn_endpoint_groups', md, autoload_with=engine)
op.bulk_insert(md.tables['vpn_endpoint_groups'], new_groups)
sa.Table('vpn_endpoints', md, autoload=True, autoload_with=engine)
sa.Table('vpn_endpoints', md, autoload_with=engine)
op.bulk_insert(md.tables['vpn_endpoints'], new_endpoints)