Fix update inventory for multiple providers
DB call method get_all_by_resource_provider_uuid queries all Inventories and filters them by provider's uuid from ResourceProvider, but query list is not valid (contains inventories for all providers), the correct way to load ResourceProvider is to use query join. Replace joinedload with contains_eager to avoid redundant joins. As result last updated provider overwrites all provider's inventories with wrong data. Closes-Bug: #1572555 Change-Id: I49fb1bf63400280635c202dea8f870d727a91e81
This commit is contained in:
parent
b3c1b3f413
commit
f266d40116
@ -308,8 +308,8 @@ class Inventory(API_BASE):
|
||||
allocation_ratio = Column(Float, nullable=False)
|
||||
resource_provider = orm.relationship(
|
||||
"ResourceProvider",
|
||||
primaryjoin=('and_(Inventory.resource_provider_id == '
|
||||
'ResourceProvider.id)'),
|
||||
primaryjoin=('Inventory.resource_provider_id == '
|
||||
'ResourceProvider.id'),
|
||||
foreign_keys=resource_provider_id)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user