Repository: cloudstack Updated Branches: refs/heads/4.4 5fe7eb335 -> 0b08d5319
CLOUDSTACK-6676: cleanup ip address details on ip disassoc (cherry picked from commit 66df43572e1a12ad2bd32f8c0aa9acaeb271828e) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/11d8c953 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/11d8c953 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/11d8c953 Branch: refs/heads/4.4 Commit: 11d8c953e3bc3fdb495aa51245f3736e60128bc2 Parents: 5fe7eb3 Author: Alena Prokharchyk <alena.prokharc...@citrix.com> Authored: Thu Jun 5 17:26:01 2014 -0700 Committer: Daan Hoogland <d...@onecht.net> Committed: Fri Jun 6 13:41:23 2014 +0200 ---------------------------------------------------------------------- engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11d8c953/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java index b569718..e1530ca 100755 --- a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java +++ b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java @@ -25,6 +25,7 @@ import javax.annotation.PostConstruct; import javax.ejb.Local; import javax.inject.Inject; +import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -63,6 +64,8 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen protected GenericSearchBuilder<IPAddressVO, Long> CountFreePublicIps; @Inject ResourceTagDao _tagsDao; + @Inject + UserIpAddressDetailsDao _detailsDao; // make it public for JUnit test public IPAddressDaoImpl() { @@ -166,6 +169,8 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen address.setSystem(false); address.setVmIp(null); address.setDisplay(true); + //remove resource details for the ip + _detailsDao.removeDetails(ipAddressId); update(ipAddressId, address); }