CLOUDSTACK-6232 allow expansion of ip on isolated networks as well

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/edf97ac8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/edf97ac8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/edf97ac8

Branch: refs/heads/4.3
Commit: edf97ac86c94741ae8964b640bdfc0234929c1e4
Parents: 0379dbb
Author: Daan Hoogland <[email protected]>
Authored: Wed Mar 12 19:36:11 2014 +0100
Committer: Daan Hoogland <[email protected]>
Committed: Wed Mar 12 19:40:08 2014 +0100

----------------------------------------------------------------------
 .../src/com/cloud/configuration/ConfigurationManagerImpl.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/edf97ac8/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java 
b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 2e2c39f..662eaae 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2643,9 +2643,10 @@ ConfigurationManagerImpl extends ManagerBase implements 
ConfigurationManager, Co
                     networkId = network.getId();
                     zoneId = network.getDataCenterId();
                 }
-            } else if (network.getGuestType() == null || 
network.getGuestType() == Network.GuestType.Isolated) {
-                throw new InvalidParameterValueException("Can't create direct 
vlan for network id=" + networkId
-                        + " with type: " + network.getGuestType());
+            } else if (network.getGuestType() == null ||
+                    (network.getGuestType() == Network.GuestType.Isolated
+                    && 
_ntwkOffServiceMapDao.areServicesSupportedByNetworkOffering(network.getNetworkOfferingId(),
 Service.SourceNat))) {
+                throw new InvalidParameterValueException("Can't create direct 
vlan for network id=" + networkId + " with type: " + network.getGuestType());
             }
         }
 

Reply via email to