DaanHoogland commented on code in PR #14370:
URL: https://github.com/apache/cloudstack/pull/14370#discussion_r4513545930
##########
framework/extensions/src/main/java/org/apache/cloudstack/framework/extensions/manager/ExtensionsManagerImpl.java:
##########
@@ -1306,10 +1314,13 @@ protected void
updateNetworkExtensionServicesOnPhysicalNetworks(ExtensionVO exte
return;
}
for (Service removedService : removedServices) {
- boolean usedByNetworkOffering = CollectionUtils.isNotEmpty(
-
networkOfferingServiceMapDao.listOfferingIdsByServiceAndProvider(removedService,
extension.getName()));
- boolean usedByVpcOffering = CollectionUtils.isNotEmpty(
-
vpcOfferingServiceMapDao.listOfferingIdsByServiceAndProvider(removedService,
extension.getName()));
+ // offering service map rows are kept when an offering is deleted,
so ignore removed offerings
+ boolean usedByNetworkOffering = networkOfferingServiceMapDao
+ .listOfferingIdsByServiceAndProvider(removedService,
extension.getName()).stream()
+ .anyMatch(offeringId ->
networkOfferingDao.findById(offeringId) != null);
+ boolean usedByVpcOffering = vpcOfferingServiceMapDao
+ .listOfferingIdsByServiceAndProvider(removedService,
extension.getName()).stream()
Review Comment:
the DAO lookups always return a list, never null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]