cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-10077) Allow account to use the same site-2-site VPN gateway with different configs for serveral VPCs
Date Mon, 11 Dec 2017 16:29:01 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-10077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16286144#comment-16286144
] 

ASF GitHub Bot commented on CLOUDSTACK-10077:
---------------------------------------------

rhtyd closed pull request #2267: CLOUDSTACK-10077: allow to have different VPN customer gateway
configs for same gateway IP
URL: https://github.com/apache/cloudstack/pull/2267
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java
index afcd4b608dd..d0439a523d0 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java
@@ -21,8 +21,6 @@
 import com.cloud.utils.db.GenericDao;
 
 public interface Site2SiteCustomerGatewayDao extends GenericDao<Site2SiteCustomerGatewayVO,
Long> {
-    Site2SiteCustomerGatewayVO findByGatewayIpAndAccountId(String ip, long accountId);
-
     Site2SiteCustomerGatewayVO findByNameAndAccountId(String name, long accountId);
 
     List<Site2SiteCustomerGatewayVO> listByAccountId(long accountId);
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java
b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java
index 4db826b6459..3aad27c3909 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java
@@ -18,8 +18,6 @@
 
 import java.util.List;
 
-
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -28,8 +26,6 @@
 
 @Component
 public class Site2SiteCustomerGatewayDaoImpl extends GenericDaoBase<Site2SiteCustomerGatewayVO,
Long> implements Site2SiteCustomerGatewayDao {
-    private static final Logger s_logger = Logger.getLogger(Site2SiteCustomerGatewayDaoImpl.class);
-
     private final SearchBuilder<Site2SiteCustomerGatewayVO> AllFieldsSearch;
 
     protected Site2SiteCustomerGatewayDaoImpl() {
@@ -40,14 +36,6 @@ protected Site2SiteCustomerGatewayDaoImpl() {
         AllFieldsSearch.done();
     }
 
-    @Override
-    public Site2SiteCustomerGatewayVO findByGatewayIpAndAccountId(String ip, long accountId)
{
-        SearchCriteria<Site2SiteCustomerGatewayVO> sc = AllFieldsSearch.create();
-        sc.setParameters("gatewayIp", ip);
-        sc.setParameters("accountId", accountId);
-        return findOneBy(sc);
-    }
-
     @Override
     public Site2SiteCustomerGatewayVO findByNameAndAccountId(String name, long accountId)
{
         SearchCriteria<Site2SiteCustomerGatewayVO> sc = AllFieldsSearch.create();
diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
index ba8c1d1ade0..f188ad3545b 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -224,9 +224,6 @@ public Site2SiteCustomerGateway createCustomerGateway(CreateVpnCustomerGatewayCm
         }
 
         long accountId = owner.getAccountId();
-        if (_customerGatewayDao.findByGatewayIpAndAccountId(gatewayIp, accountId) != null)
{
-            throw new InvalidParameterValueException("The customer gateway with ip " + gatewayIp
+ " already existed in the system!");
-        }
         if (_customerGatewayDao.findByNameAndAccountId(name, accountId) != null) {
             throw new InvalidParameterValueException("The customer gateway with name " +
name + " already existed!");
         }
@@ -480,11 +477,7 @@ public Site2SiteCustomerGateway updateCustomerGateway(UpdateVpnCustomerGatewayCm
         checkCustomerGatewayCidrList(guestCidrList);
 
         long accountId = gw.getAccountId();
-        Site2SiteCustomerGatewayVO existedGw = _customerGatewayDao.findByGatewayIpAndAccountId(gatewayIp,
accountId);
-        if (existedGw != null && existedGw.getId() != gw.getId()) {
-            throw new InvalidParameterValueException("The customer gateway with ip " + gatewayIp
+ " already existed in the system!");
-        }
-        existedGw = _customerGatewayDao.findByNameAndAccountId(name, accountId);
+        Site2SiteCustomerGatewayVO existedGw = _customerGatewayDao.findByNameAndAccountId(name,
accountId);
         if (existedGw != null && existedGw.getId() != gw.getId()) {
             throw new InvalidParameterValueException("The customer gateway with name " +
name + " already existed!");
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Allow account to use the same site-2-site VPN gateway with different configs for serveral
VPCs
> ----------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-10077
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10077
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: VPC
>    Affects Versions: 4.5.2, 4.10.0.0, 4.9.3.0
>            Reporter: René Moser
>            Assignee: René Moser
>         Attachments: Selection_044.jpg
>
>
> Related https://github.com/apache/cloudstack/commit/86bbe211f2341d52d1d64b0b6d3abcdcef85d3ee
and CLOUDSTACK-494
> Currently we can not have serveral VPCs in one account with different VPN customer gateways
configuration per same gateway IP. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message