cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anim...@apache.org
Subject [7/7] git commit: updated refs/heads/4.3 to 91ec548
Date Mon, 03 Feb 2014 00:24:39 GMT
CLOUDSTACK-5062: Deleting Load Balancing Rule fails when generating
usage events are enabled

Signed-off-by: Daan Hoogland <daan@onecht.net>(cherry picked from commit 62a259ffa9b4daabcbe4f9afe9a78eadebbb7bff)
Signed-off-by: Animesh Chaturvedi <animesh@apache.org>


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

Branch: refs/heads/4.3
Commit: 91ec548fc0b08aa4ff8e6aa57fab013ab9892893
Parents: c0e70b5
Author: David Grizzanti <dgrizzanti@gmail.com>
Authored: Fri Jan 31 11:25:59 2014 +0100
Committer: Animesh Chaturvedi <animesh@apache.org>
Committed: Sun Feb 2 16:10:35 2014 -0800

----------------------------------------------------------------------
 .../com/cloud/network/lb/LoadBalancingRulesManagerImpl.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/91ec548f/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index bd58e39..b830910 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1405,7 +1405,8 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase
implements
         
                 if (generateUsageEvent) {
                     // Generate usage event right after all rules were marked for revoke
-                    UsageEventUtils.publishUsageEvent(EventTypes.EVENT_LOAD_BALANCER_DELETE,
lb.getAccountId(), 0, lb.getId(),
+                    Network network = _networkModel.getNetwork(lb.getNetworkId());
+                    UsageEventUtils.publishUsageEvent(EventTypes.EVENT_LOAD_BALANCER_DELETE,
lb.getAccountId(), network.getDataCenterId(), lb.getId(),
                             null, LoadBalancingRule.class.getName(), lb.getUuid());
                 }
                 
@@ -2052,6 +2053,11 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase
implements
         List<String> serviceStates = new ArrayList<String>();
         List<LoadBalancerVMMapVO> vmLoadBalancerMappings = null;
         vmLoadBalancerMappings = _lb2VmMapDao.listByLoadBalancerId(loadBalancerId);
+        if(vmLoadBalancerMappings == null) {
+            String msg = "no VM Loadbalancer Mapping found";
+            s_logger.error(msg);
+            throw new CloudRuntimeException(msg);
+        }
         Map<Long, String> vmServiceState = new HashMap<Long, String>(vmLoadBalancerMappings.size());
         List<Long> appliedInstanceIdList = new ArrayList<Long>();
 


Mime
View raw message