You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2013/12/16 15:05:53 UTC

git commit: updated refs/heads/4.3 to 307e058

Updated Branches:
  refs/heads/4.3 df1662353 -> 307e05869


CLOUDSTACK-5517: NPE observed during "release portable IPs" as part of
account cleanup

ensure proper portable ip address are released  as part of account
cleanup


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

Branch: refs/heads/4.3
Commit: 307e0586902bb5b1775652e31bca02c8326e15d9
Parents: df16623
Author: Murali Reddy <mu...@gmail.com>
Authored: Mon Dec 16 19:34:32 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Mon Dec 16 19:34:32 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/user/AccountManagerImpl.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/307e0586/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 8ea495f..22abf78 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -750,11 +750,14 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
 
             // release account specific acquired portable IP's. Since all the portable IP's must have been already
             // disassociated with VPC/guest network (due to deletion), so just mark portable IP as free.
-            List<? extends IpAddress> portableIpsToRelease = _ipAddressDao.listByAccount(accountId);
-            for (IpAddress ip : portableIpsToRelease) {
-                s_logger.debug("Releasing portable ip " + ip + " as a part of account id=" + accountId + " cleanup");
-                _ipAddrMgr.releasePortableIpAddress(ip.getId());
+            List<? extends IpAddress> ipsToRelease = _ipAddressDao.listByAccount(accountId);
+            for (IpAddress ip : ipsToRelease) {
+                if (ip.isPortable()) {
+                    s_logger.debug("Releasing portable ip " + ip + " as a part of account id=" + accountId + " cleanup");
+                    _ipAddrMgr.releasePortableIpAddress(ip.getId());
+                }
             }
+
             // release dedication if any
             List<DedicatedResourceVO> dedicatedResources = _dedicatedDao.listByAccountId(accountId);
             if (dedicatedResources != null && !dedicatedResources.isEmpty()) {