mirror of https://github.com/apache/cloudstack.git
bug 1443: even adding host failed, return success in api. status 14443: resolved fixed; Reviewed-by: sheng
This commit is contained in:
parent
cfd48da3f1
commit
5797baa3ff
|
|
@ -263,7 +263,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");
|
||||
return null;
|
||||
List<HostVO> hosts = _resourceMgr.findHostByGuid(dcId, guid);
|
||||
if (hosts.size() == 1) {
|
||||
return hosts.get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -139,4 +139,6 @@ public interface ResourceManager extends ResourceService{
|
|||
HypervisorType getAvailableHypervisor(long zoneId);
|
||||
|
||||
Discoverer getMatchingDiscover(HypervisorType hypervisorType);
|
||||
|
||||
List<HostVO> findHostByGuid(long dcId, String guid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1984,6 +1984,14 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
|
|||
sc.addAnd(sc.getEntity().getResourceState(), Op.EQ, ResourceState.Enabled);
|
||||
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
|
||||
public List<HostVO> listAllHostsInCluster(long clusterId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue