This commit is contained in:
Erik Böck 2026-07-04 14:36:11 +00:00 committed by GitHub
commit bb1aea1c9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -540,7 +540,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
}
if (imageStore == null) {
throw new CloudRuntimeException(String.format("Cannot find an image store for zone [%s].", zoneId));
throwExceptionForImageStoreObtentionFailure(zoneId, "upload volume");
}
return imageStore;
@ -1962,7 +1962,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
}
DataStore store = _dataStoreMgr.getImageStoreWithFreeCapacity(zoneId);
if (store == null) {
throw new CloudRuntimeException("cannot find an image store for zone " + zoneId);
throwExceptionForImageStoreObtentionFailure(zoneId, "create template");
}
AsyncCallFuture<TemplateApiResult> future;
@ -2814,4 +2814,9 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
return _tmpltDao.findById(template.getId());
}
private void throwExceptionForImageStoreObtentionFailure(Long zoneId, String operation) {
logger.error("Cannot find an image store for zone [{}].", zoneId);
throw new CloudRuntimeException(String.format("Failed to %s. Please contact the cloud administrator.", operation));
}
}