LibvirtServerDiscoverer should only process added KVM hosts (#7979)

Don't use LibvirtServerDiscoverer's processHostAdded() in CustomServerDiscoverer

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
This commit is contained in:
Marcus Sorensen 2023-09-28 00:40:26 -06:00 committed by GitHub
parent b20554820b
commit 348a63dc98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -29,4 +29,9 @@ public class CustomServerDiscoverer extends LibvirtServerDiscoverer {
protected String getPatchPath() {
return "scripts/vm/hypervisor/kvm/";
}
@Override
public void processHostAdded(long hostId) {
// Not using super class implementation here.
}
}

View File

@ -110,7 +110,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
@Override
public void processHostAdded(long hostId) {
HostVO host = hostDao.findById(hostId);
if (host != null) {
if (host != null && getHypervisorType().equals(host.getHypervisorType())) {
directDownloadManager.syncCertificatesToHost(hostId, host.getDataCenterId());
}
}