mirror of https://github.com/apache/cloudstack.git
Merge 087440609a into 5893ba5a8c
This commit is contained in:
commit
cbed8908d3
|
|
@ -530,7 +530,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;
|
||||
|
|
@ -1770,7 +1770,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;
|
||||
|
||||
|
|
@ -2599,4 +2599,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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue