Oved Ourfali has uploaded a new change for review.

Change subject: core: glance import as template should fail on old DCs
......................................................................

core: glance import as template should fail on old DCs

If the DC compatibility level is less than 3.4 then the glance import should 
fail on canDoAction.
This patch adds this validation

Change-Id: I4b975d2f8d540af6f0a3c8e4de9296173950f9ce
Bug-Url: https://bugzilla.redhat.com/1072023
Signed-off-by: Oved Ourfali <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCommand.java
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/25286/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCommand.java
index 6a68b1c..d005b56 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCommand.java
@@ -20,6 +20,7 @@
 import org.ovirt.engine.core.common.businessentities.DiskImage;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
 import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.compat.Version;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -200,6 +201,12 @@
             if (getVdsGroup().getArchitecture() == ArchitectureType.undefined) 
{
                 return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_UNDEFINED_ARCHITECTURE);
             }
+
+            setStoragePoolId(getParameters().getStoragePoolId());
+            // Importing as a template is available only for DC level 3.4 and 
above
+            if 
(getStoragePool().getcompatibility_version().compareTo(Version.v3_4) < 0) {
+                return 
failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL);
+            }
         }
 
         DiskImage diskImage = null;


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b975d2f8d540af6f0a3c8e4de9296173950f9ce
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Oved Ourfali <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to