You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2014/11/07 12:59:41 UTC
git commit: updated refs/heads/master to 330bd27
Repository: cloudstack
Updated Branches:
refs/heads/master 7c5bc4ae7 -> 330bd2748
CLOUDSTACK-7859: Host tags are not getting removed in cloud.host_tags table when a Host is deleted from CS.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/330bd274
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/330bd274
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/330bd274
Branch: refs/heads/master
Commit: 330bd2748e6936be2b27dec37c9c53711e74e6dc
Parents: 7c5bc4a
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Fri Nov 7 16:55:50 2014 +0530
Committer: Sanjay Tripathi <sa...@citrix.com>
Committed: Fri Nov 7 17:32:25 2014 +0530
----------------------------------------------------------------------
engine/schema/src/com/cloud/host/dao/HostTagsDao.java | 2 ++
engine/schema/src/com/cloud/host/dao/HostTagsDaoImpl.java | 10 ++++++++++
server/src/com/cloud/resource/ResourceManagerImpl.java | 7 +++++--
3 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/330bd274/engine/schema/src/com/cloud/host/dao/HostTagsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/host/dao/HostTagsDao.java b/engine/schema/src/com/cloud/host/dao/HostTagsDao.java
index 8901716..c811de9 100644
--- a/engine/schema/src/com/cloud/host/dao/HostTagsDao.java
+++ b/engine/schema/src/com/cloud/host/dao/HostTagsDao.java
@@ -29,4 +29,6 @@ public interface HostTagsDao extends GenericDao<HostTagVO, Long> {
List<String> getDistinctImplicitHostTags(List<Long> hostIds, String[] implicitHostTags);
+ void deleteTags(long hostId);
+
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/330bd274/engine/schema/src/com/cloud/host/dao/HostTagsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/host/dao/HostTagsDaoImpl.java b/engine/schema/src/com/cloud/host/dao/HostTagsDaoImpl.java
index 7e8615a..e275e04 100644
--- a/engine/schema/src/com/cloud/host/dao/HostTagsDaoImpl.java
+++ b/engine/schema/src/com/cloud/host/dao/HostTagsDaoImpl.java
@@ -72,6 +72,16 @@ public class HostTagsDaoImpl extends GenericDaoBase<HostTagVO, Long> implements
}
@Override
+ public void deleteTags(long hostId) {
+ TransactionLegacy txn = TransactionLegacy.currentTxn();
+ txn.start();
+ SearchCriteria<HostTagVO> sc = HostSearch.create();
+ sc.setParameters("hostId", hostId);
+ expunge(sc);
+ txn.commit();
+ }
+
+ @Override
public void persist(long hostId, List<String> hostTags) {
TransactionLegacy txn = TransactionLegacy.currentTxn();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/330bd274/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 5887783..5cc2d36 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -847,8 +847,11 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
// delete host details
_hostDetailsDao.deleteDetails(hostId);
- // if host is GPU enabled, delete GPU entries
- _hostGpuGroupsDao.deleteGpuEntries(hostId);
+ // if host is GPU enabled, delete GPU entries
+ _hostGpuGroupsDao.deleteGpuEntries(hostId);
+
+ // delete host tags
+ _hostTagsDao.deleteTags(hostId);
host.setGuid(null);
Long clusterId = host.getClusterId();