Skip to content

Commit 9db7307

Browse files
committed
[stable-only] Add writer DB context to "add_provisioning_component"
To ensure the "standardatributes" register is present during the creation of the "provisioningblocks" register, the method "add_provisioning_component" is wrapped with a database writer context. That will ensure the standard attribute ID, used as a foreign key in the "provisioningblocks" table, is present during the transaction. Closes-Bug: #1991222 Change-Id: If57d822ff617c2f9b5e5cade7d4ca74065376e55
1 parent a06dab2 commit 9db7307

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

neutron/db/provisioning_blocks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def add_model_for_resource(resource, model):
4242

4343

4444
@db_api.retry_if_session_inactive()
45+
@db_api.CONTEXT_WRITER
4546
def add_provisioning_component(context, object_id, object_type, entity):
4647
"""Adds a provisioning block by an entity to a given object.
4748

0 commit comments

Comments
 (0)