mirror of https://github.com/apache/cloudstack.git
[Simulator] Fix NPE in SolidFireHostListener (#5955)
* [Simulator] Fix NPE in SolidFireHostListener * address comments * Update plugins/storage/volume/solidfire/src/main/java/org/apache/cloudstack/storage/datastore/provider/SolidFireSharedHostListener.java Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com> Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
This commit is contained in:
parent
7aa9d3cd51
commit
9f23fbe7b6
|
|
@ -73,13 +73,18 @@ public class SolidFireHostListener implements HypervisorHostListener {
|
|||
HostVO host = hostDao.findById(hostId);
|
||||
|
||||
if (host == null) {
|
||||
LOGGER.error("Failed to add host by SolidFireHostListener as host was not found with id = " + hostId);
|
||||
LOGGER.error(String.format("Failed to add host by SolidFireHostListener as host was not found with id = %s ", hostId));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (host.getClusterId() == null) {
|
||||
LOGGER.error("Failed to add host by SolidFireHostListener as host has no associated cluster id");
|
||||
return false;
|
||||
}
|
||||
|
||||
SolidFireUtil.hostAddedToCluster(hostId, host.getClusterId(), SolidFireUtil.PROVIDER_NAME,
|
||||
clusterDao, hostDao, storagePoolDao, storagePoolDetailsDao);
|
||||
clusterDao, hostDao, storagePoolDao, storagePoolDetailsDao);
|
||||
|
||||
handleVMware(host, true, ModifyTargetsCommand.TargetTypeToRemove.NEITHER);
|
||||
|
||||
|
|
|
|||
|
|
@ -67,13 +67,18 @@ public class SolidFireSharedHostListener implements HypervisorHostListener {
|
|||
HostVO host = hostDao.findById(hostId);
|
||||
|
||||
if (host == null) {
|
||||
LOGGER.error("Failed to add host by SolidFireSharedHostListener as host was not found with id = " + hostId);
|
||||
LOGGER.error(String.format("Failed to add host by SolidFireSharedHostListener as host was not found with id = %s ", hostId));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (host.getClusterId() == null) {
|
||||
LOGGER.error("Failed to add host by SolidFireSharedHostListener as host has no associated cluster id");
|
||||
return false;
|
||||
}
|
||||
|
||||
SolidFireUtil.hostAddedToCluster(hostId, host.getClusterId(), SolidFireUtil.SHARED_PROVIDER_NAME,
|
||||
clusterDao, hostDao, storagePoolDao, storagePoolDetailsDao);
|
||||
clusterDao, hostDao, storagePoolDao, storagePoolDetailsDao);
|
||||
|
||||
handleVMware(host, true, ModifyTargetsCommand.TargetTypeToRemove.NEITHER);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue