Skip to content

Commit b2e20a1

Browse files
brtkwrgmaanos
andcommitted
Make code compatible with SQLAlchemy 1.4.18
Also, plugins do not need to enable any network service other than what devstack is already doing [1]. Also, fix doc build: - bump up tox minversion to 3.18 - set ignore_basepython_conflict to True [2] - add tex-gyre to binddep.txt [3] [1] https://review.opendev.org/c/openstack/devstack/+/791436 [2] https://github.com/openstack/nova/blob/a0ec2de968cfded8b88c2f3af1152b5932d675b7/tox.ini#L7 [3] https://review.opendev.org/c/openstack/openstack-health/+/793984 Change-Id: Ib6e3ed40dc8b075c3cecb967b7417097e3cab60d Co-authored-by: Ghanshyam Mann <[email protected]>
1 parent 042d2ad commit b2e20a1

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

bindep.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This is a cross-platform list tracking distribution packages needed by tests;
22
# see http://docs.openstack.org/infra/bindep/ for additional information.
3-
43
graphviz [doc test]
54
vim
5+
6+
# PDF Docs package dependencies
7+
tex-gyre [doc platform:dpkg]

devstack/settings

-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
# PHYSICAL_NETWORK=public
1515
# OVS_PHYSICAL_BRIDGE=br-ex
1616

17-
# Enable Neutron which is required by Magnum and disable nova-network.
18-
disable_service n-net
19-
enable_service q-svc
20-
enable_service q-agt
21-
enable_service q-dhcp
22-
enable_service q-l3
23-
enable_service q-meta
24-
enable_service neutron
25-
2617
# Enable Magnum services
2718
enable_service magnum-api
2819
enable_service magnum-cond

magnum/db/sqlalchemy/api.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def _do_update_cluster(self, cluster_id, values):
286286
query = model_query(models.Cluster, session=session)
287287
query = add_identity_filter(query, cluster_id)
288288
try:
289-
ref = query.with_lockmode('update').one()
289+
ref = query.with_for_update().one()
290290
except NoResultFound:
291291
raise exception.ClusterNotFound(cluster=cluster_id)
292292

@@ -344,7 +344,7 @@ def get_cluster_template_by_id(self, context, cluster_template_id):
344344
query = self._add_tenant_filters(context, query)
345345
public_q = model_query(models.ClusterTemplate).filter_by(public=True)
346346
query = query.union(public_q)
347-
query = query.filter_by(id=cluster_template_id)
347+
query = query.filter_by(cluster_template_id=cluster_template_id)
348348
try:
349349
return query.one()
350350
except NoResultFound:
@@ -356,7 +356,7 @@ def get_cluster_template_by_uuid(self, context, cluster_template_uuid):
356356
query = self._add_tenant_filters(context, query)
357357
public_q = model_query(models.ClusterTemplate).filter_by(public=True)
358358
query = query.union(public_q)
359-
query = query.filter_by(uuid=cluster_template_uuid)
359+
query = query.filter_by(cluster_template_uuid=cluster_template_uuid)
360360
try:
361361
return query.one()
362362
except NoResultFound:
@@ -368,7 +368,7 @@ def get_cluster_template_by_name(self, context, cluster_template_name):
368368
query = self._add_tenant_filters(context, query)
369369
public_q = model_query(models.ClusterTemplate).filter_by(public=True)
370370
query = query.union(public_q)
371-
query = query.filter_by(name=cluster_template_name)
371+
query = query.filter_by(cluster_template_name=cluster_template_name)
372372
try:
373373
return query.one()
374374
except MultipleResultsFound:
@@ -427,7 +427,7 @@ def _do_update_cluster_template(self, cluster_template_id, values):
427427
query = model_query(models.ClusterTemplate, session=session)
428428
query = add_identity_filter(query, cluster_template_id)
429429
try:
430-
ref = query.with_lockmode('update').one()
430+
ref = query.with_for_update().one()
431431
except NoResultFound:
432432
raise exception.ClusterTemplateNotFound(
433433
clustertemplate=cluster_template_id)
@@ -497,7 +497,7 @@ def _do_update_x509keypair(self, x509keypair_id, values):
497497
query = model_query(models.X509KeyPair, session=session)
498498
query = add_identity_filter(query, x509keypair_id)
499499
try:
500-
ref = query.with_lockmode('update').one()
500+
ref = query.with_for_update().one()
501501
except NoResultFound:
502502
raise exception.X509KeyPairNotFound(x509keypair=x509keypair_id)
503503

@@ -539,7 +539,7 @@ def update_magnum_service(self, magnum_service_id, values):
539539
query = model_query(models.MagnumService, session=session)
540540
query = add_identity_filter(query, magnum_service_id)
541541
try:
542-
ref = query.with_lockmode('update').one()
542+
ref = query.with_for_update().one()
543543
except NoResultFound:
544544
raise exception.MagnumServiceNotFound(
545545
magnum_service_id=magnum_service_id)
@@ -623,7 +623,7 @@ def update_quota(self, project_id, values):
623623
try:
624624
query = query.filter_by(project_id=project_id).filter_by(
625625
resource=resource)
626-
ref = query.with_lockmode('update').one()
626+
ref = query.with_for_update().one()
627627
except NoResultFound:
628628
msg = (_('project_id %(project_id)s resource %(resource)s.') %
629629
{'project_id': project_id, 'resource': resource})
@@ -775,7 +775,7 @@ def _do_update_federation(self, federation_id, values):
775775
query = model_query(models.Federation, session=session)
776776
query = add_identity_filter(query, federation_id)
777777
try:
778-
ref = query.with_lockmode('update').one()
778+
ref = query.with_for_update().one()
779779
except NoResultFound:
780780
raise exception.FederationNotFound(federation=federation_id)
781781

@@ -837,7 +837,7 @@ def _do_update_nodegroup(self, cluster_id, nodegroup_id, values):
837837
query = add_identity_filter(query, nodegroup_id)
838838
query = query.filter_by(cluster_id=cluster_id)
839839
try:
840-
ref = query.with_lockmode('update').one()
840+
ref = query.with_for_update().one()
841841
except NoResultFound:
842842
raise exception.NodeGroupNotFound(nodegroup=nodegroup_id)
843843

tox.ini

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[tox]
2-
minversion = 2.0
2+
minversion = 3.18
33
envlist = py37,pep8
44
skipsdist = True
5+
ignore_basepython_conflict = True
56

67
[testenv]
78
basepython = python3
@@ -106,16 +107,18 @@ setenv =
106107
commands = {toxinidir}/tools/cover.sh {posargs}
107108

108109
[testenv:docs]
109-
deps = -r{toxinidir}/doc/requirements.txt
110-
commands = sphinx-build -W --keep-going -b html doc/source doc/build/html
110+
deps =
111+
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
112+
-r{toxinidir}/doc/requirements.txt
113+
commands =
114+
rm -rf doc/build/html doc/build/doctrees
115+
sphinx-build -W --keep-going -b html -j auto doc/source doc/build/html
111116

112117
[testenv:pdf-docs]
113-
basepython = python3
114118
deps = {[testenv:docs]deps}
115-
whitelist_externals =
116-
make
117119
commands =
118-
sphinx-build -b latex doc/source doc/build/pdf
120+
rm -rf doc/build/pdf
121+
sphinx-build -W --keep-going -b latex -j auto doc/source doc/build/pdf
119122
make -C doc/build/pdf
120123

121124
[testenv:genconfig]

0 commit comments

Comments
 (0)