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/4.4-forward to 69add34
Date Mon, 28 Apr 2014 12:55:19 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward 6f7f9996f -> 69add34ad


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/69add34a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/69add34a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/69add34a

Branch: refs/heads/4.4-forward
Commit: 69add34ad0f07674f5ed560ef708b706e038a3dd
Parents: 6f7f999
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:55:06 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/69add34a/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 4343650..2820135 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -3977,9 +3977,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/69add34a/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 c517fb1..3e83c81 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1590,9 +1590,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