incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject git commit: S2S VPN: Add check for router status before apply vpn
Date Tue, 24 Jul 2012 02:53:45 GMT
Updated Branches:
  refs/heads/vpc 4d4284585 -> 6cb10ce99


S2S VPN: Add check for router status before apply vpn


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

Branch: refs/heads/vpc
Commit: 6cb10ce993138d5f1f234ca0674dbbd968a54cff
Parents: 4d42845
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Mon Jul 23 19:53:06 2012 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Mon Jul 23 19:53:39 2012 -0700

----------------------------------------------------------------------
 .../VpcVirtualNetworkApplianceManagerImpl.java     |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6cb10ce9/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index 7b920ac..5b14b9b 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -1022,11 +1022,23 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
 
     @Override
     public boolean startSite2SiteVpn(Site2SiteVpnConnection conn, VirtualRouter router) throws
ResourceUnavailableException {
+        if (router.getState() != State.Running) {
+            s_logger.warn("Unable to apply site-to-site VPN configuration, virtual router
is not in the right state " + router.getState());
+            throw new ResourceUnavailableException("Unable to apply site 2 site VPN configuration,"
+
+                    " virtual router is not in the right state", DataCenter.class, router.getDataCenterIdToDeployIn());
+        }
+
         return applySite2SiteVpn(true, router, conn);
     }
 
     @Override
     public boolean stopSite2SiteVpn(Site2SiteVpnConnection conn, VirtualRouter router) throws
ResourceUnavailableException {
+        if (router.getState() != State.Running) {
+            s_logger.warn("Unable to apply site-to-site VPN configuration, virtual router
is not in the right state " + router.getState());
+            throw new ResourceUnavailableException("Unable to apply site 2 site VPN configuration,"
+
+                    " virtual router is not in the right state", DataCenter.class, router.getDataCenterIdToDeployIn());
+        }
+
         return applySite2SiteVpn(false, router, conn);
     }
 


Mime
View raw message