cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/4] git commit: updated refs/heads/hotfix/4.4/upgradepath-431to441 to 062bec4
Date Thu, 04 Sep 2014 20:45:34 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/hotfix/4.4/upgradepath-431to441 e57f17ae8 -> 062bec4ee (forced update)


CLOUDSTACK-7418 and CLOUDSTACK-7488 - Fixed LB removal if cert is associated


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

Branch: refs/heads/hotfix/4.4/upgradepath-431to441
Commit: 6c501dba45468d216f0d3d41adaa8e05cc083321
Parents: c900aac
Author: Will Stevens <wstevens@cloudops.com>
Authored: Thu Sep 4 12:49:23 2014 -0400
Committer: Will Stevens <wstevens@cloudops.com>
Committed: Thu Sep 4 12:49:23 2014 -0400

----------------------------------------------------------------------
 .../com/cloud/network/lb/LoadBalancingRulesManagerImpl.java | 9 +++++++++
 .../org/apache/cloudstack/network/lb/CertServiceImpl.java   | 4 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c501dba/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 e29d8c3..c2707bb 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -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)
{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c501dba/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
index 347bfc2..b5e4a17 100644
--- a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
+++ b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
@@ -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);
         }


Mime
View raw message