weizhouapache commented on code in PR #13032:
URL: https://github.com/apache/cloudstack/pull/13032#discussion_r3334384390
##########
framework/extensions/src/main/java/org/apache/cloudstack/framework/extensions/manager/ExtensionsManagerImpl.java:
##########
@@ -965,6 +1403,55 @@ public void unregisterExtensionWithCluster(Cluster
cluster, Long extensionId) {
}
}
+ protected void unregisterExtensionWithPhysicalNetwork(String resourceId,
Long extensionId) {
+ PhysicalNetworkVO physicalNetwork =
physicalNetworkDao.findByUuid(resourceId);
+ if (physicalNetwork == null) {
+ try {
+ physicalNetwork =
physicalNetworkDao.findById(Long.parseLong(resourceId));
+ } catch (NumberFormatException ignored) {
+ }
+ }
+ if (physicalNetwork == null) {
+ throw new InvalidParameterValueException("Invalid physical network
ID specified");
+ }
+ // Find the specific map entry for this extension+physical-network
combination
+ List<ExtensionResourceMapVO> existingList =
extensionResourceMapDao.listByResourceIdAndType(
+ physicalNetwork.getId(),
ExtensionResourceMap.ResourceType.PhysicalNetwork);
+ if (existingList == null || existingList.isEmpty()) {
Review Comment:
fixing
--
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]