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_r373134659
 
 

 ##########
 File path: server/src/main/java/com/cloud/network/NetworkServiceImpl.java
 ##########
 @@ -2993,6 +2993,20 @@ public PhysicalNetwork updatePhysicalNetwork(Long id, 
String networkSpeed, List<
             throw new InvalidParameterException("Unable to support more than 
one tag on network yet");
         }
 
+        // If tags are null, then check if there are any other networks with 
null tags
+        // of the same traffic type. If so then dont update the tags
+        if (tags != null && tags.size() == 0) {
+            // Get all physical networks according to traffic type
+            Pair<List<PhysicalNetworkTrafficTypeVO>, Integer> result = 
_pNTrafficTypeDao
+                    .listAndCountBy(network.getId());
+            if (result.second() > 0) {
+                for (PhysicalNetworkTrafficTypeVO physicalNetworkTrafficTypeVO 
: result.first()) {
+                    TrafficType trafficType = 
physicalNetworkTrafficTypeVO.getTrafficType();
+                    checkForPhysicalNetworksWithoutTag(network, trafficType);
+                }
+            }
+        }
 
 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

Reply via email to