Updated Branches:
  refs/heads/master 4d0a460ba -> 73f8f46af

deletGlobalLoadbalancer rule was only markign the rule as revoked, but
never removing it from the DB after applying the configuration on GSLB
provider. This fix will delete the rule from the DB.


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

Branch: refs/heads/master
Commit: 73f8f46afdcc8cd1bb9b0fbbd4ac65d7093688c6
Parents: 4d0a460
Author: Murali Reddy <murali.re...@citrix.com>
Authored: Wed Apr 17 19:05:47 2013 +0530
Committer: Murali Reddy <murali.re...@citrix.com>
Committed: Wed Apr 17 19:07:31 2013 +0530

----------------------------------------------------------------------
 .../gslb/GlobalLoadBalancingRulesServiceImpl.java  |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/73f8f46a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
 
b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
index 696e6e9..1ed2618 100644
--- 
a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
+++ 
b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java
@@ -392,6 +392,7 @@ public class GlobalLoadBalancingRulesServiceImpl implements 
GlobalLoadBalancingR
             //mark all the GSLB-LB mapping to be in revoke state
             for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) {
                 gslbLbMap.setRevoke(true);
+                _gslbLbMapDao.update(gslbLbMap.getId(), gslbLbMap);
             }
         }
 
@@ -411,6 +412,16 @@ public class GlobalLoadBalancingRulesServiceImpl 
implements GlobalLoadBalancingR
             throw new CloudRuntimeException("Failed to update the gloabal load 
balancer");
         }
 
+        txn.start();
+        //remove all mappings between GSLB rule and load balancer rules
+        if (gslbLbMapVos != null) {
+            for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) {
+                _gslbLbMapDao.remove(gslbLbMap.getId());
+            }
+        }
+        //remove the GSLB rule itself
+        _gslbRuleDao.remove(gslbRuleId);
+        txn.commit();
         return success;
     }
 

Reply via email to