cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject git commit: CLOUDSTACK-191: Update checking for updateCustomerGateway
Date Thu, 04 Oct 2012 22:40:40 GMT
Updated Branches:
  refs/heads/4.0 1ff798ca7 -> a43834674


CLOUDSTACK-191: Update checking for updateCustomerGateway

Reviewed-by: Anthony Xu

Conflicts:

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


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

Branch: refs/heads/4.0
Commit: a4383467455553671242ea64bcdb4d05823c5fd3
Parents: 1ff798c
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Mon Sep 24 16:39:01 2012 -0700
Committer: Alex Huang <alex.huang@citrix.com>
Committed: Thu Oct 4 15:40:14 2012 -0700

----------------------------------------------------------------------
 .../cloud/network/vpn/Site2SiteVpnManagerImpl.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a4383467/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 db678ae..ae0f4ec 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -468,12 +468,14 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager,
Manager {
         }
 
         checkCustomerGatewayCidrList(guestCidrList);
-        
+
         long accountId = gw.getAccountId();
-        if (_customerGatewayDao.findByGatewayIp(gatewayIp) != null) {
+        Site2SiteCustomerGatewayVO existedGw = _customerGatewayDao.findByGatewayIp(gatewayIp);
+        if (existedGw != null && existedGw.getId() != gw.getId()) {
             throw new InvalidParameterValueException("The customer gateway with ip " + gatewayIp
+ " already existed in the system!");
         }
-        if (_customerGatewayDao.findByNameAndAccountId(name, accountId) != null) {
+        existedGw = _customerGatewayDao.findByNameAndAccountId(name, accountId);
+        if (existedGw != null && existedGw.getId() != gw.getId()) {
             throw new InvalidParameterValueException("The customer gateway with name " +
name + " already existed!");
         }
 


Mime
View raw message