mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7418 and CLOUDSTACK-7488 - Fixed LB removal if cert is associated
This commit is contained in:
commit
0fa0320860
|
|
@ -1478,6 +1478,15 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
|
|||
final LoadBalancerVO lb = _lbDao.findById(loadBalancerId);
|
||||
FirewallRule.State backupState = lb.getState();
|
||||
|
||||
// remove any ssl certs associated with this LB rule before trying to delete it.
|
||||
LoadBalancerCertMapVO lbCertMap = _lbCertMapDao.findByLbRuleId(loadBalancerId);
|
||||
if (lbCertMap != null) {
|
||||
boolean removeResult = removeCertFromLoadBalancer(loadBalancerId);
|
||||
if (!removeResult) {
|
||||
throw new CloudRuntimeException("Unable to remove certificate from load balancer rule " + loadBalancerId);
|
||||
}
|
||||
}
|
||||
|
||||
List<LoadBalancerVMMapVO> backupMaps = Transaction.execute(new TransactionCallback<List<LoadBalancerVMMapVO>>() {
|
||||
@Override
|
||||
public List<LoadBalancerVMMapVO> doInTransaction(TransactionStatus status) {
|
||||
|
|
|
|||
|
|
@ -325,7 +325,9 @@ public class CertServiceImpl implements CertService {
|
|||
List<String> lbIds = new ArrayList<String>();
|
||||
for (LoadBalancerCertMapVO mapVO : lbCertMap) {
|
||||
LoadBalancer lb = _entityMgr.findById(LoadBalancerVO.class, mapVO.getLbId());
|
||||
lbIds.add(lb.getUuid());
|
||||
if (lb != null) {
|
||||
lbIds.add(lb.getUuid());
|
||||
}
|
||||
}
|
||||
response.setLbIds(lbIds);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue