cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/master to 3bd594c
Date Mon, 28 Apr 2014 12:41:28 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 881792991 -> 3bd594c58


CLOUDSTACK-6485: private gateway network should not be associated with vpc

Signed-off-by: Daan Hoogland <daan@onecht.net>


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

Branch: refs/heads/master
Commit: 3bd594c584f34dff2ea69a942202f79b87d44698
Parents: 8817929
Author: Daan Hoogland <daan@onecht.net>
Authored: Sat Apr 19 02:25:41 2014 +0200
Committer: Daan Hoogland <daan@onecht.net>
Committed: Mon Apr 28 14:40:52 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkServiceImpl.java | 6 +++---
 server/src/com/cloud/network/vpc/VpcManagerImpl.java | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3bd594c5/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index c0791ae..c18146a 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -3781,9 +3781,9 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
         } else {
             s_logger.debug("Private network already exists: " + privateNetwork);
             //Do not allow multiple private gateways with same Vlan within a VPC
-                        if (vpcId.equals(privateNetwork.getVpcId())) {
-                            throw new InvalidParameterValueException("Private network for
the vlan: " + uriString + " and cidr  " + cidr + "  already exists " + "for Vpc " + vpcId
-                                    + " in zone " + _entityMgr.findById(DataCenter.class,
pNtwk.getDataCenterId()).getName());
+            if (vpcId != null && vpcId.equals(privateNetwork.getVpcId())) {
+                throw new InvalidParameterValueException("Private network for the vlan: "
+ uriString + " and cidr  " + cidr + "  already exists " + "for Vpc " + vpcId
+                        + " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName());
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3bd594c5/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 0c33fc6..5263d56 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1589,9 +1589,9 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         if (privateNtwk == null) {
             s_logger.info("creating new network for vpc " + vpc + " using broadcast uri:
" + broadcastUri);
             String networkName = "vpc-" + vpc.getName() + "-privateNetwork";
-                        privateNtwk =
-                            _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal,
broadcastUri, ipAddress, null, gateway, netmask,
-                                gatewayOwnerId, vpcId, isSourceNat, networkOfferingId);
+            /* vpcid should not be set on the new network as it is not part of the vpc but
an outside net */
+            privateNtwk = _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal,
broadcastUri, ipAddress, null,
+                    gateway, netmask, gatewayOwnerId, null, isSourceNat, networkOfferingId);
         } else { // create the nic/ip as createPrivateNetwork doesn''t do that work for us
now
                         s_logger.info("found and using existing network for vpc " + vpc +
": " + broadcastUri);
                         DataCenterVO dc = _dcDao.lockRow(physNetFinal.getDataCenterId(),
true);


Mime
View raw message