Skip to content

Commit f1532cd

Browse files
committed
Replace deprecated with_lockmode with with_for_update
The Query.with_lockmode() method is deprecated since version 0.9.0 and will be removed in a future release. [1] This patch replaces it with Query.with_for_update(). [1] https://docs.sqlalchemy.org/en/13/orm/query.html#sqlalchemy.orm.query.Query.with_lockmode Change-Id: I78e692e08440afc38ac2697fabfa566fff5f0a9f
1 parent d42a007 commit f1532cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nova/db/sqlalchemy/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ def floating_ip_update(context, address, values):
11481148
def dnsdomain_get(context, fqdomain):
11491149
return model_query(context, models.DNSDomain, read_deleted="no").\
11501150
filter_by(domain=fqdomain).\
1151-
with_lockmode('update').\
1151+
with_for_update().\
11521152
first()
11531153

11541154

@@ -3101,7 +3101,7 @@ def network_query(project_filter, id=None):
31013101
filter_kwargs['id'] = id
31023102
return model_query(context, models.Network, read_deleted="no").\
31033103
filter_by(**filter_kwargs).\
3104-
with_lockmode('update').\
3104+
with_for_update().\
31053105
first()
31063106

31073107
if not force:

0 commit comments

Comments
 (0)