sureshanaparti commented on code in PR #13897:
URL: https://github.com/apache/cloudstack/pull/13897#discussion_r3977349670


##########
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
##########
@@ -765,7 +765,11 @@ protected Void 
managedCopyBaseImageCallback(AsyncCallbackDispatcher<VolumeServic
             volume.setPath(templateObjectTo.getPath());
 
             if (templateObjectTo.getFormat() != null) {
-                volume.setFormat(templateObjectTo.getFormat());
+                PrimaryDataStore primaryDataStore = 
context.getPrimaryDataStore();
+                boolean isOntap = primaryDataStore != null && 
DataStoreProvider.ONTAP_PLUGIN_NAME.equals(primaryDataStore.getStorageProviderName());

Review Comment:
   ```suggestion
                   boolean isOntapDataStore = primaryDataStore != null && 
DataStoreProvider.ONTAP_PLUGIN_NAME.equals(primaryDataStore.getStorageProviderName());
   ```



##########
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java:
##########
@@ -765,7 +765,11 @@ protected Void 
managedCopyBaseImageCallback(AsyncCallbackDispatcher<VolumeServic
             volume.setPath(templateObjectTo.getPath());
 
             if (templateObjectTo.getFormat() != null) {
-                volume.setFormat(templateObjectTo.getFormat());
+                PrimaryDataStore primaryDataStore = 
context.getPrimaryDataStore();
+                boolean isOntap = primaryDataStore != null && 
DataStoreProvider.ONTAP_PLUGIN_NAME.equals(primaryDataStore.getStorageProviderName());
+                if (!isOntap || volume.getFormat() == null) {

Review Comment:
   ```suggestion
                   if (!isOntapDataStore || volume.getFormat() == null) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to