This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new 5447950f095 Allow creation of Shared Networks without IP range if 
network offering has no services - specifyvlan = true (#10168)
5447950f095 is described below

commit 5447950f095d035b53a8ff257f6f71c8f14b104e
Author: Pearl Dsilva <pearl1...@gmail.com>
AuthorDate: Fri Jan 31 05:38:34 2025 -0500

    Allow creation of Shared Networks without IP range if network offering has 
no services - specifyvlan = true (#10168)
---
 server/src/main/java/com/cloud/network/NetworkServiceImpl.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java 
b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
index d0711a9fcf9..d4279c29112 100644
--- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
@@ -34,6 +34,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.UUID;
 
@@ -1634,6 +1635,10 @@ public class NetworkServiceImpl extends ManagerBase 
implements NetworkService, C
             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");
+        }
+
         Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, 
privateMtu, zone.getId());
         mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu, privateMtu);
 

Reply via email to