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);
|
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);
|
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
|
@Override
|
||||||
public void persist(long hostId, List<String> hostTags) {
|
public void persist(long hostId, List<String> hostTags) {
|
||||||
TransactionLegacy txn = TransactionLegacy.currentTxn();
|
TransactionLegacy txn = TransactionLegacy.currentTxn();
|
||||||
|
|||||||
@ -850,6 +850,9 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
|
|||||||
// if host is GPU enabled, delete GPU entries
|
// if host is GPU enabled, delete GPU entries
|
||||||
_hostGpuGroupsDao.deleteGpuEntries(hostId);
|
_hostGpuGroupsDao.deleteGpuEntries(hostId);
|
||||||
|
|
||||||
|
// delete host tags
|
||||||
|
_hostTagsDao.deleteTags(hostId);
|
||||||
|
|
||||||
host.setGuid(null);
|
host.setGuid(null);
|
||||||
Long clusterId = host.getClusterId();
|
Long clusterId = host.getClusterId();
|
||||||
host.setClusterId(null);
|
host.setClusterId(null);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user