Skip to content

Commit 73f8f46

Browse files
author
Murali Reddy
committed
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.
1 parent 4d0a460 commit 73f8f46

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ public boolean deleteGlobalLoadBalancerRule(DeleteGlobalLoadBalancerRuleCmd dele
392392
//mark all the GSLB-LB mapping to be in revoke state
393393
for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) {
394394
gslbLbMap.setRevoke(true);
395+
_gslbLbMapDao.update(gslbLbMap.getId(), gslbLbMap);
395396
}
396397
}
397398

@@ -411,6 +412,16 @@ public boolean deleteGlobalLoadBalancerRule(DeleteGlobalLoadBalancerRuleCmd dele
411412
throw new CloudRuntimeException("Failed to update the gloabal load balancer");
412413
}
413414

415+
txn.start();
416+
//remove all mappings between GSLB rule and load balancer rules
417+
if (gslbLbMapVos != null) {
418+
for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) {
419+
_gslbLbMapDao.remove(gslbLbMap.getId());
420+
}
421+
}
422+
//remove the GSLB rule itself
423+
_gslbRuleDao.remove(gslbRuleId);
424+
txn.commit();
414425
return success;
415426
}
416427

0 commit comments

Comments
 (0)