mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 1443: even adding host failed, return success in api. status 14443: resolved fixed; Reviewed-by: sheng
This commit is contained in:
parent
04312dabc4
commit
1e4893b69c
@ -274,7 +274,12 @@ public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
s_logger.debug("Timeout, to wait for the host connecting to mgt svr, assuming it is failed");
|
s_logger.debug("Timeout, to wait for the host connecting to mgt svr, assuming it is failed");
|
||||||
return null;
|
List<HostVO> hosts = _resourceMgr.findHostByGuid(dcId, guid);
|
||||||
|
if (hosts.size() == 1) {
|
||||||
|
return hosts.get(0);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -139,4 +139,6 @@ public interface ResourceManager extends ResourceService{
|
|||||||
HypervisorType getAvailableHypervisor(long zoneId);
|
HypervisorType getAvailableHypervisor(long zoneId);
|
||||||
|
|
||||||
Discoverer getMatchingDiscover(HypervisorType hypervisorType);
|
Discoverer getMatchingDiscover(HypervisorType hypervisorType);
|
||||||
|
|
||||||
|
List<HostVO> findHostByGuid(long dcId, String guid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2005,6 +2005,14 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
|
|||||||
sc.addAnd(sc.getEntity().getResourceState(), Op.EQ, ResourceState.Enabled);
|
sc.addAnd(sc.getEntity().getResourceState(), Op.EQ, ResourceState.Enabled);
|
||||||
return sc.list();
|
return sc.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HostVO> findHostByGuid(long dcId, String guid) {
|
||||||
|
SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
|
||||||
|
sc.addAnd(sc.getEntity().getDataCenterId(), Op.EQ, dcId);
|
||||||
|
sc.addAnd(sc.getEntity().getGuid(), Op.EQ, guid);
|
||||||
|
return sc.list();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<HostVO> listAllHostsInCluster(long clusterId) {
|
public List<HostVO> listAllHostsInCluster(long clusterId) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user