weizhouapache commented on code in PR #10704:
URL: https://github.com/apache/cloudstack/pull/10704#discussion_r2044411425


##########
server/src/main/java/com/cloud/network/NetworkServiceImpl.java:
##########
@@ -1635,10 +1635,19 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) 
throws InsufficientCapac
             throwInvalidIdException("Network offering with specified id 
doesn't support adding multiple ip ranges", ntwkOff.getUuid(), 
NETWORK_OFFERING_ID);
         }
 
-        if (GuestType.Shared == ntwkOff.getGuestType() && 
!ntwkOff.isSpecifyVlan() && Objects.isNull(associatedNetworkId)) {
-            throw new CloudRuntimeException("Associated network must be 
provided when creating Shared networks when specifyVlan is false");
-        }
 
+
+        if (GuestType.Shared == ntwkOff.getGuestType()) {
+            if (!ntwkOff.isSpecifyIpRanges()) {
+                throw new CloudRuntimeException("The 'specifyipranges' 
parameter should be true for Shared Networks");
+            }

Review Comment:
   there is already a check when create the network offering
   
   
https://github.com/apache/cloudstack/blob/b2b2218a8abf750c92a31bd89078d96b5c65159e/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java#L6720-L6730
   



-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to