DaanHoogland commented on a change in pull request #3780: Enhancement: Allow
creating atmost 1 physical network with null tag
URL: https://github.com/apache/cloudstack/pull/3780#discussion_r373133907
##########
File path: server/src/main/java/com/cloud/network/NetworkModelImpl.java
##########
@@ -1154,13 +1154,15 @@ public long findPhysicalNetworkId(long zoneId, String
tag, TrafficType trafficTy
}
if (pNtwks.size() > 1) {
- if (tag == null) {
- throw new InvalidParameterValueException("More than one
physical networks exist in zone id=" + zoneId +
- " and no tags are specified in order to make a choice");
- }
-
Long pNtwkId = null;
for (PhysicalNetwork pNtwk : pNtwks) {
+ if (pNtwk.getTags().isEmpty() && tag == null) {
+ s_logger.debug("Found physical network id=" +
pNtwk.getId() + " with null tag");
+ if (pNtwkId != null) {
+ throw new CloudRuntimeException("There is more than 1
physical network with empty tag in the zone id=" + zoneId);
+ }
+ pNtwkId = pNtwk.getId();
+ }
Review comment:
method call
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services