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.
This commit is contained in:
Murali Reddy 2013-04-17 19:05:47 +05:30
parent 4d0a460bad
commit 73f8f46afd
1 changed files with 11 additions and 0 deletions

View File

@ -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;
}