soreana commented on code in PR #6781:
URL: https://github.com/apache/cloudstack/pull/6781#discussion_r995443068
##########
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java:
##########
@@ -6748,6 +6737,33 @@ public Pair<List<? extends NetworkOffering>, Integer>
searchForNetworkOfferings(
}
}
+ private boolean allowNetworkOfferingWithNullTag(Long zoneId, List<String>
pNtwkTags) {
+ boolean allowNullTag = false;
+ final List<PhysicalNetworkVO> pNtwks =
_physicalNetworkDao.listByZoneAndTrafficType(zoneId, TrafficType.Guest);
+ for (final PhysicalNetworkVO pNtwk : pNtwks) {
+ final List<String> pNtwkTag = pNtwk.getTags();
+ if (pNtwkTag == null || pNtwkTag.isEmpty()) {
+ if (!allowNullTag) {
+ allowNullTag = true;
+ } else {
+ throw new CloudRuntimeException("There are more than 1
physical network with empty tag in the zone id=" + zoneId);
+ }
+ } else {
+ pNtwkTags.addAll(pNtwkTag);
+ }
+ }
+ return allowNullTag;
+ }
+
+ private boolean checkNetworkOfferingTags(List<String> pNtwkTags, boolean
allowNullTag, String offeringTags) {
+ if (offeringTags == null && !allowNullTag) {
+ return false;
+ } else if (offeringTags != null && !pNtwkTags.contains(offeringTags)) {
+ return false;
+ }
Review Comment:
Good catch. Done.
--
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]