SWIFT : do not sync template to swift if it is marked as destroyed in secondry stoarge

This commit is contained in:
anthony 2011-12-16 21:27:58 -08:00
parent 141cceacef
commit a85864e160
2 changed files with 4 additions and 1 deletions

View File

@ -204,7 +204,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
} }
String result = swiftUpload(swift, "T-" + templateId.toString(), lPath, "*"); String result = swiftUpload(swift, "T-" + templateId.toString(), lPath, "*");
if (result != null) { if (result != null) {
String errMsg = "failed to download template from Swift to secondary storage " + lPath + " , err=" + result; String errMsg = "failed to upload template from secondary storage " + lPath + " to swift , err=" + result;
s_logger.debug(errMsg); s_logger.debug(errMsg);
return new Answer(cmd, false, errMsg); return new Answer(cmd, false, errMsg);
} }

View File

@ -883,6 +883,9 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
try { try {
List<VMTemplateHostVO> templtHostRefs = _tmpltHostDao.listByState(VMTemplateHostVO.Status.DOWNLOADED); List<VMTemplateHostVO> templtHostRefs = _tmpltHostDao.listByState(VMTemplateHostVO.Status.DOWNLOADED);
for (VMTemplateHostVO templtHostRef : templtHostRefs) { for (VMTemplateHostVO templtHostRef : templtHostRefs) {
if (templtHostRef.getDestroyed()) {
continue;
}
if (!templateIds.contains(templtHostRef.getTemplateId())) { if (!templateIds.contains(templtHostRef.getTemplateId())) {
continue; continue;
} }