cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [1/2] git commit: updated refs/heads/4.2-forward to 798f34a
Date Thu, 19 Sep 2013 20:20:19 GMT
Updated Branches:
  refs/heads/4.2-forward a14145bb5 -> 798f34a49


CLOUDSTACK-4573: fixed resource limit check when acquire public IP in VPC - update resource
count for VPC public ip even when network_id is not set yet.


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

Branch: refs/heads/4.2-forward
Commit: cea14ce8802f1f61522491f2581abbd776436ccf
Parents: a14145b
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Sep 19 10:57:34 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Sep 19 10:57:34 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkManagerImpl.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cea14ce8/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 2c00c5b..7042e18 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -551,7 +551,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager,
L
                         addr.getSystem(), addr.getClass().getName(), addr.getUuid());
             }
             // don't increment resource count for direct and dedicated ip addresses
-            if (addr.getAssociatedWithNetworkId() != null && !isIpDedicated(addr))
{
+            if (updateIpResourceCount(addr)) {
                 _resourceLimitMgr.incrementResourceCount(owner.getId(), ResourceType.public_ip);
             }
         }
@@ -3783,7 +3783,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager,
L
             txn.start();
 
             // don't decrement resource count for direct and dedicated ips
-            if (ip.getAssociatedWithNetworkId() != null && !isIpDedicated(ip)) {
+            if (updateIpResourceCount(ip)) {
                 _resourceLimitMgr.decrementResourceCount(_ipAddressDao.findById(addrId).getAllocatedToAccountId(),
ResourceType.public_ip);
             }
 
@@ -3807,7 +3807,10 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager,
L
 
         return ip;
     }
-
+    
+    protected boolean updateIpResourceCount(IPAddressVO ip) {
+        return (ip.getAssociatedWithNetworkId() != null || ip.getVpcId() != null) &&
!isIpDedicated(ip);
+    }
     
 
     Random _rand = new Random(System.currentTimeMillis());


Mime
View raw message