From aeb8036393f46f9644ee996fa8e91467480f970f Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Tue, 18 Jul 2023 10:06:13 +0000 Subject: [PATCH] [sqlalchemy-20] Replace Query.get() with Session.get() The Query.get() method is considered legacy as of the 1.x series of SQLAlchemy and becomes a legacy construct in 2.0. This should be replaced with Session.get() method. Closes-Bug: #2027604 Change-Id: Ib81f2c36a93f08844a629f165d2323bf1198d465 --- neutron/plugins/ml2/driver_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/plugins/ml2/driver_context.py b/neutron/plugins/ml2/driver_context.py index a98404cdf23..9942068fe03 100644 --- a/neutron/plugins/ml2/driver_context.py +++ b/neutron/plugins/ml2/driver_context.py @@ -42,7 +42,7 @@ class InstanceSnapshot(object): object and updates the object with the column values stored in this snapshot. """ - db_obj = session.query(self._model_class).get(self._identity_key) + db_obj = session.get(self._model_class, self._identity_key) if db_obj: for col in self._cols: setattr(db_obj, col, getattr(self, col))