You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/05/13 10:37:37 UTC

[1/2] git commit: updated refs/heads/4.4 to 169c2be

Repository: cloudstack
Updated Branches:
  refs/heads/4.4 02bd3d067 -> 169c2be11


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.


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

Branch: refs/heads/4.4
Commit: ed7bd0022e23352c8ec57bdd832b49451db88e73
Parents: 02bd3d0
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon May 12 18:26:53 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Tue May 13 10:36:50 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed7bd002/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 1d6ed22..a34aa6c 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -264,13 +264,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 +
+            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


[2/2] git commit: updated refs/heads/4.4 to 169c2be

Posted by da...@apache.org.
CLOUDSTACK-6607: Correct the result of VpcNetworkUsage

Blank or not shouldn't be used to indicate command is failure or not.


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

Branch: refs/heads/4.4
Commit: 169c2be11acfe3af86f8e1f8061f24846cc34e47
Parents: ed7bd00
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon May 12 18:25:18 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Tue May 13 10:37:23 2014 +0200

----------------------------------------------------------------------
 .../xen/resource/XenServer56Resource.java       | 49 ++++++++++----------
 1 file changed, 24 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/169c2be1/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
index 1bdcc3d..8031f59 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
@@ -16,25 +16,6 @@
 // under the License.
 package com.cloud.hypervisor.xen.resource;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.ejb.Local;
-
-import org.apache.log4j.Logger;
-import org.apache.xmlrpc.XmlRpcException;
-
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.Host;
-import com.xensource.xenapi.Network;
-import com.xensource.xenapi.PIF;
-import com.xensource.xenapi.Types.IpConfigurationMode;
-import com.xensource.xenapi.Types.XenAPIException;
-import com.xensource.xenapi.VLAN;
-import com.xensource.xenapi.VM;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckOnHostAnswer;
 import com.cloud.agent.api.CheckOnHostCommand;
@@ -45,9 +26,26 @@ import com.cloud.agent.api.NetworkUsageAnswer;
 import com.cloud.agent.api.NetworkUsageCommand;
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.resource.ServerResource;
+import com.cloud.utils.ExecutionResult;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.script.Script;
 import com.cloud.utils.ssh.SSHCmdHelper;
+import com.xensource.xenapi.Connection;
+import com.xensource.xenapi.Host;
+import com.xensource.xenapi.Network;
+import com.xensource.xenapi.PIF;
+import com.xensource.xenapi.Types.IpConfigurationMode;
+import com.xensource.xenapi.Types.XenAPIException;
+import com.xensource.xenapi.VLAN;
+import com.xensource.xenapi.VM;
+import org.apache.log4j.Logger;
+import org.apache.xmlrpc.XmlRpcException;
+
+import javax.ejb.Local;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
 
 @Local(value = ServerResource.class)
 public class XenServer56Resource extends CitrixResourceBase {
@@ -178,11 +176,15 @@ public class XenServer56Resource extends CitrixResourceBase {
                 return new NetworkUsageAnswer(cmd, "success", 0L, 0L);
             }
 
-            String result = executeInVR(cmd.getPrivateIP(), "vpc_netusage.sh", args).getDetails();
+            ExecutionResult result = executeInVR(cmd.getPrivateIP(), "vpc_netusage.sh", args);
+            String detail = result.getDetails();
+            if (!result.isSuccess()) {
+                throw new Exception(" vpc network usage plugin call failed ");
+            }
             if (option.equals("get") || option.equals("vpn")) {
                 long[] stats = new long[2];
-                if (result != null) {
-                    String[] splitResult = result.split(":");
+                if (detail != null) {
+                    String[] splitResult = detail.split(":");
                     int i = 0;
                     while (i < splitResult.length - 1) {
                         stats[0] += (new Long(splitResult[i++])).longValue();
@@ -191,9 +193,6 @@ public class XenServer56Resource extends CitrixResourceBase {
                     return new NetworkUsageAnswer(cmd, "success", stats[0], stats[1]);
                 }
             }
-            if (result == null || result.isEmpty()) {
-                throw new Exception(" vpc network usage plugin call failed ");
-            }
             return new NetworkUsageAnswer(cmd, "success", 0L, 0L);
         } catch (Exception ex) {
             s_logger.warn("Failed to get network usage stats due to ", ex);