cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaya...@apache.org
Subject git commit: updated refs/heads/master to 73d53e5
Date Thu, 21 Aug 2014 12:23:05 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 19ffc93e2 -> 73d53e5f4


CLOUDSTACK-7349: Catching exception in API assigntoloadbalancerrule command


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

Branch: refs/heads/master
Commit: 73d53e5f43dcb3a3caa502ffff5fea2b07a74d55
Parents: 19ffc93
Author: Jayapal <jayapal@apache.org>
Authored: Thu Aug 21 11:00:04 2014 +0530
Committer: Jayapal <jayapal@apache.org>
Committed: Thu Aug 21 17:42:33 2014 +0530

----------------------------------------------------------------------
 .../user/loadbalancer/AssignToLoadBalancerRuleCmd.java      | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/73d53e5f/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
index dd9adef..fdc8a31 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
@@ -23,6 +23,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import com.cloud.utils.exception.CloudRuntimeException;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.APICommand;
@@ -165,8 +166,14 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
         CallContext.current().setEventDetails("Load balancer Id: " + getLoadBalancerId()
+ " VmIds: " + StringUtils.join(getVirtualMachineIds(), ","));
 
         Map<Long, List<String>> vmIdIpsMap = getVmIdIpListMap();
+        boolean result = false;
+
+        try {
+            result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds,
vmIdIpsMap);
+        }catch (CloudRuntimeException ex) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign load
balancer rule");
+        }
 
-        boolean result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds,
vmIdIpsMap);
         if (result) {
             SuccessResponse response = new SuccessResponse(getCommandName());
             setResponseObject(response);


Mime
View raw message