CLOUDSTACK-5501: Allow one vpn customer gateway with multiple connections

This restriction was purposely avoid confusion of VPN setup, but later found too
strictly and cause troubles for deployment. Removed after testing one customer
gateway with multiple connections.

(cherry picked from commit 0a62eb8380390acc7b76a211ef802de0e19aaf13)
Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>

Conflicts:
        server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java


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

Branch: refs/heads/4.3
Commit: e9c5a03fb0253261b466fd1e3b496cbd500a8049
Parents: 6cd4b28
Author: Sheng Yang <sheng.y...@citrix.com>
Authored: Mon May 12 18:26:53 2014 -0700
Committer: Rohit Yadav <rohit.ya...@shapeblue.com>
Committed: Wed Nov 26 23:36:47 2014 +0530

----------------------------------------------------------------------
 .../src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java  | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9c5a03f/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java 
b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
index 4b21cb2..db7533e 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -250,14 +250,9 @@ public class Site2SiteVpnManagerImpl extends ManagerBase 
implements Site2SiteVpn
         }
 
         if 
(_vpnConnectionDao.findByVpnGatewayIdAndCustomerGatewayId(vpnGatewayId, 
customerGatewayId) != null) {
-            throw new InvalidParameterValueException("The vpn connection with 
customer gateway id " + customerGatewayId + " or vpn gateway id " 
-                    + vpnGatewayId + " already existed!");
+            throw new InvalidParameterValueException("The vpn connection with 
customer gateway id " + customerGatewayId + " and vpn gateway id " + 
vpnGatewayId +
+                " already existed!");
         }
-        if (_vpnConnectionDao.findByCustomerGatewayId(customerGatewayId) != 
null) {
-            throw new InvalidParameterValueException("The vpn connection with 
specified customer gateway id " + customerGatewayId +
-                    " already exists!");
-        }
-
         String[] cidrList = customerGateway.getGuestCidrList().split(",");
 
         // Remote sub nets cannot overlap VPC's sub net

Reply via email to