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

[1/2] git commit: updated refs/heads/4.4-forward to a3e9d0f

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward 7e6390d3c -> a3e9d0ff1


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/4adee0a5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4adee0a5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4adee0a5

Branch: refs/heads/4.4-forward
Commit: 4adee0a55e36045f2fd76b35b1cc7de14cb3493a
Parents: 7e6390d
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon May 12 18:25:18 2014 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Mon May 12 18:25:18 2014 -0700

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4adee0a5/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);


[2/2] git commit: updated refs/heads/4.4-forward to a3e9d0f

Posted by ya...@apache.org.
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/a3e9d0ff
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a3e9d0ff
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a3e9d0ff

Branch: refs/heads/4.4-forward
Commit: a3e9d0ff12deb36fa304795a089345869cc29a08
Parents: 4adee0a
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon May 12 18:26:53 2014 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Mon May 12 18:26:53 2014 -0700

----------------------------------------------------------------------
 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/a3e9d0ff/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