Maor Lipchuk has uploaded a new change for review.

Change subject: core: Validate Storage Domain for Importing Template from 
configuration
......................................................................

core: Validate Storage Domain for Importing Template from configuration

For each disk in the template, we should fetch the Storage Domain and
validate that it exists and active.
Today, we set the storage id for each image and then use
getStorageDomain method to fetch
the Storage Domain with that id, but when the Storage Domain being
initialized, it will always check
the first Storage Domain every time.

Change-Id: I2bfe3ba9b48747650291a887255e85358ed0799a
Bug-Url: https://bugzilla.redhat.com/1138200
Bug-Url: https://bugzilla.redhat.com/1140560
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/32/33132/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
index 3b6c19d..78eefb2 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
@@ -168,8 +168,9 @@
         }
 
         for (DiskImage image : getImages()) {
-            setStorageDomainId(image.getStorageIds().get(0));
-            if (!validate(new 
StorageDomainValidator(getStorageDomain()).isDomainExistAndActive())) {
+            StorageDomain sd = getStorageDomainDAO().getForStoragePool(
+                    image.getStorageIds().get(0), getStoragePool().getId());
+            if (!validate(new 
StorageDomainValidator(sd).isDomainExistAndActive())) {
                 return false;
             }
         }


-- 
To view, visit http://gerrit.ovirt.org/33132
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bfe3ba9b48747650291a887255e85358ed0799a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to