mirror of https://github.com/apache/cloudstack.git
Merge 087440609a into b7d4df0a11
This commit is contained in:
commit
bb1aea1c9d
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue