mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7859: Host tags are not getting removed in cloud.host_tags table when a Host is deleted from CS.
This commit is contained in:
parent
7c5bc4ae7e
commit
330bd2748e
@ -29,4 +29,6 @@ public interface HostTagsDao extends GenericDao<HostTagVO, Long> {
|
||||
|
||||
List<String> getDistinctImplicitHostTags(List<Long> hostIds, String[] implicitHostTags);
|
||||
|
||||
void deleteTags(long hostId);
|
||||
|
||||
}
|
||||
|
||||
@ -71,6 +71,16 @@ public class HostTagsDaoImpl extends GenericDaoBase<HostTagVO, Long> implements
|
||||
return customSearch(sc, null);
|
||||
}
|
||||
|
||||
@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();
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user