Updated Branches:
  refs/heads/internallb c773d204c -> 2e8e2f98f

InternalLB: don't allow to upgrade the network from the network offering with 
internal LB to the offering with public LB, and vice versa


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

Branch: refs/heads/internallb
Commit: 2e8e2f98f59eecfc37a2645bd353de7f592d8149
Parents: c773d20
Author: Alena Prokharchyk <[email protected]>
Authored: Wed May 1 13:53:20 2013 -0700
Committer: Alena Prokharchyk <[email protected]>
Committed: Wed May 1 14:06:01 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkServiceImpl.java  |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e8e2f98/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java 
b/server/src/com/cloud/network/NetworkServiceImpl.java
index 8b77528..8c38904 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -2194,6 +2194,14 @@ public class NetworkServiceImpl extends ManagerBase 
implements  NetworkService {
                 return false;
             }
         }
+        
+        //can't update from internal LB to public LB
+        if (areServicesSupportedByNetworkOffering(oldNetworkOfferingId, 
Service.Lb) && areServicesSupportedByNetworkOffering(newNetworkOfferingId, 
Service.Lb)) {
+            if (oldNetworkOffering.getPublicLb() != 
newNetworkOffering.getPublicLb() || oldNetworkOffering.getInternalLb() != 
newNetworkOffering.getInternalLb()) {
+                throw new InvalidParameterValueException("Original and new 
offerings support different types of LB - Internal vs Public," +
+                               " can't upgrade");
+            }
+        }
 
         return canIpsUseOffering(publicIps, newNetworkOfferingId);
     }

Reply via email to