[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
(cherry picked from commit 9db730764c
)
This commit is contained in:
parent
e5ab8d85c3
commit
e1a45c82f3
|
@ -41,6 +41,7 @@ def add_model_for_resource(resource, model):
|
|||
|
||||
|
||||
@db_api.retry_if_session_inactive()
|
||||
@db_api.CONTEXT_WRITER
|
||||
def add_provisioning_component(context, object_id, object_type, entity):
|
||||
"""Adds a provisioning block by an entity to a given object.
|
||||
|
||||
|
|
Loading…
Reference in New Issue