revert wrong fix of 24bcb4ddf210fbd4ca6032bb5aa6bd02f7480a73 that built-in templates can not be found

The root cause is we didn't return SSVM in connecting status when doing template sync
This commit is contained in:
frank 2011-10-31 15:26:44 -07:00
parent 46dac852fa
commit 09fc1be631
3 changed files with 6 additions and 6 deletions

View File

@ -379,7 +379,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
public Answer sendToSecStorage(HostVO ssHost, Command cmd) {
if( ssHost.getType() == Host.Type.LocalSecondaryStorage ) {
return easySend(ssHost.getId(), cmd);
} else if ( ssHost.getType() == Host.Type.SecondaryStorage || ssHost.getType() == Host.Type.SecondaryStorageVM) {
} else if ( ssHost.getType() == Host.Type.SecondaryStorage) {
return sendToSSVM(ssHost.getDataCenterId(), cmd);
} else {
String msg = "do not support Secondary Storage type " + ssHost.getType();

View File

@ -585,7 +585,7 @@ public class DownloadMonitorImpl implements DownloadMonitor {
}
long sserverId = ssHost.getId();
long zoneId = ssHost.getDataCenterId();
if (!(ssHost.getType() == Host.Type.SecondaryStorage || ssHost.getType() == Host.Type.LocalSecondaryStorage || ssHost.getType() == Host.Type.SecondaryStorageVM)) {
if (!(ssHost.getType() == Host.Type.SecondaryStorage || ssHost.getType() == Host.Type.LocalSecondaryStorage)) {
s_logger.warn("Huh? Agent id " + sserverId + " is not secondary storage host");
return;
}

View File

@ -1275,7 +1275,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
@Override
public HostVO findSecondaryStorageHost(long dcId) {
SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
sc.addAnd(sc.getEntity().getType(), Op.IN, Host.Type.SecondaryStorage, Host.Type.SecondaryStorageVM);
sc.addAnd(sc.getEntity().getType(), Op.EQ, Host.Type.SecondaryStorage);
sc.addAnd(sc.getEntity().getDataCenterId(), Op.EQ, dcId);
List<HostVO> storageHosts = sc.list();
if (storageHosts == null || storageHosts.size() < 1) {
@ -1289,7 +1289,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
@Override
public List<HostVO> listSecondaryStorageHostsInAllZones() {
SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
sc.addAnd(sc.getEntity().getType(), Op.IN, Host.Type.SecondaryStorage, Host.Type.SecondaryStorageVM);
sc.addAnd(sc.getEntity().getType(), Op.EQ, Host.Type.SecondaryStorage);
return sc.list();
}
@ -1297,7 +1297,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
public List<HostVO> listSecondaryStorageHostsInOneZone(long dataCenterId) {
SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
sc.addAnd(sc.getEntity().getDataCenterId(), Op.EQ, dataCenterId);
sc.addAnd(sc.getEntity().getType(), Op.IN, Host.Type.SecondaryStorage, Host.Type.SecondaryStorageVM);
sc.addAnd(sc.getEntity().getType(), Op.EQ, Host.Type.SecondaryStorage);
return sc.list();
}
@ -1313,7 +1313,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
public List<HostVO> listAllTypesSecondaryStorageHostsInOneZone(long dataCenterId) {
SearchCriteriaService<HostVO, HostVO> sc = SearchCriteria2.create(HostVO.class);
sc.addAnd(sc.getEntity().getDataCenterId(), Op.EQ, dataCenterId);
sc.addAnd(sc.getEntity().getType(), Op.IN, Host.Type.LocalSecondaryStorage, Host.Type.SecondaryStorage, Host.Type.SecondaryStorageVM);
sc.addAnd(sc.getEntity().getType(), Op.IN, Host.Type.LocalSecondaryStorage, Host.Type.SecondaryStorage);
return sc.list();
}