This is an automated email from the ASF dual-hosted git repository. sureshanaparti pushed a commit to branch 4.20 in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 7acd5a3875669c17190bb321aeeca3ccf5547fdf Merge: cda3640be15 de5188e50c8 Author: Suresh Kumar Anaparti <[email protected]> AuthorDate: Mon Aug 4 16:42:49 2025 +0530 Merge branch '4.19' into 4.20 .../org/apache/cloudstack/metrics/MetricsServiceImpl.java | 2 +- .../storage/datastore/driver/SwiftImageStoreDriverImpl.java | 13 ++++++++++--- ui/src/views/infra/AddSecondaryStorage.vue | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --cc plugins/storage/image/swift/src/main/java/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java index c3a82c42189,44f321f9543..4bed0780e20 --- a/plugins/storage/image/swift/src/main/java/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java +++ b/plugins/storage/image/swift/src/main/java/org/apache/cloudstack/storage/datastore/driver/SwiftImageStoreDriverImpl.java @@@ -24,10 -24,6 +24,9 @@@ import java.util.UUID import javax.inject.Inject; +import com.cloud.configuration.Config; +import com.cloud.utils.SwiftUtil; - import org.apache.cloudstack.framework.config.dao.ConfigurationDao; + import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; @@@ -99,8 -99,13 +101,13 @@@ public class SwiftImageStoreDriverImpl @Override public void createAsync(DataStore dataStore, DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) { Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes(); - VirtualMachineTemplate tmpl = _templateDao.findById(data.getId()); DataStore cacheStore = cacheManager.getCacheStorage(dataStore.getScope()); + if (cacheStore == null) { + String errMsg = String.format("No cache store found for scope: %s", + dataStore.getScope().getScopeType().name()); - s_logger.error(errMsg); ++ logger.error(errMsg); + throw new CloudRuntimeException(errMsg); + } DownloadCommand dcmd = new DownloadCommand((TemplateObjectTO)(data.getTO()), maxTemplateSizeInBytes); dcmd.setCacheStore(cacheStore.getTO()); dcmd.setProxy(getHttpProxy());
