Omer Frenkel has uploaded a new change for review.

Change subject: core: better message on import template version
......................................................................

core: better message on import template version

when trying to add a template version, which its base template is
missing, the message you get is not clear.

in this patch a better message provided.

Change-Id: I9fbf2c45c03fe9838bf25be5529c93c322372b28
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1073035
Signed-off-by: Omer Frenkel <ofren...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
M 
frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
6 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/71/26071/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
index a4063b5..4c2dbf4 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
@@ -206,7 +206,7 @@
             VmTemplate baseTemplate = 
getVmTemplateDAO().get(getVmTemplate().getBaseTemplateId());
             if (baseTemplate == null) {
                 retVal = false;
-                
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST);
+                
addCanDoActionMessage(VdcBllMessages.VMT_CANNOT_IMPORT_TEMPLATE_VERSION_MISSING_BASE);
             }
         }
         if (!retVal) {
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
index 4c81df1..7823c02 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
@@ -386,6 +386,7 @@
     VMT_CANNOT_CREATE_DUPLICATE_NAME(ErrorType.CONFLICT),
     VMT_CLUSTER_IS_NOT_VALID(ErrorType.BAD_PARAMETERS),
     VMT_CANNOT_IMPORT_TEMPLATE_EXISTS(ErrorType.CONFLICT),
+    VMT_CANNOT_IMPORT_TEMPLATE_VERSION_MISSING_BASE(ErrorType.BAD_PARAMETERS),
     VMT_CANNOT_REMOVE_DOMAINS_LIST_MISMATCH(ErrorType.CONFLICT),
     VM_CANNOT_IMPORT_TEMPLATE_NAME_EXISTS(ErrorType.CONFLICT),
     ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID(ErrorType.BAD_PARAMETERS),
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
index 1c8fb7c..6625aae 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
@@ -669,6 +669,7 @@
 ACTION_TYPE_FAILED_MAX_NUM_CPU=Cannot ${action} ${type}. Max number of cpu 
exceeded
 ACTION_TYPE_FAILED_MAX_NUM_SOCKETS=Cannot ${action} ${type}. Max number of 
sockets exceeded
 VMT_CANNOT_IMPORT_TEMPLATE_EXISTS=Import Template failed - Template Id already 
exist in the system. Please remove the Template (${TemplateName}) from the 
system first
+VMT_CANNOT_IMPORT_TEMPLATE_VERSION_MISSING_BASE=Cannot import Template 
Version, Base Template for this Version is missing, please first Import Base 
Template, or Import Version as Base Template using Clone.
 VM_CANNOT_IMPORT_TEMPLATE_NAME_EXISTS=Import Template failed - Template Name 
already exist in the system. Please rename the Template in the system first
 VM_CANNOT_IMPORT_VM_EXISTS=Import VM failed - VM Id already exist in the 
system. Please remove the VM (${VmName}) from the system first
 VM_CANNOT_IMPORT_VM_NAME_EXISTS=Import VM failed - VM Name already exist in 
the system. Please rename the VM in the system first
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
index 8a8b874..8f4ce34 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
@@ -1819,6 +1819,9 @@
     @DefaultStringValue("Import Template failed - Template Id already exist in 
the system. Please remove the Template (${TemplateName}) from the system first")
     String VMT_CANNOT_IMPORT_TEMPLATE_EXISTS();
 
+    @DefaultStringValue("Cannot import Template Version, Base Template for 
this Version is missing, please first Import Base Template, or Import Version 
as Base Template using Clone.")
+    String VMT_CANNOT_IMPORT_TEMPLATE_VERSION_MISSING_BASE();
+
     @DefaultStringValue("Import Template failed - Template Name already exist 
in the system. Please rename the Template in the system first")
     String VM_CANNOT_IMPORT_TEMPLATE_NAME_EXISTS();
 
diff --git 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index 09c8374..fa4e3e8 100644
--- 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -648,6 +648,7 @@
 ACTION_TYPE_FAILED_MAX_NUM_CPU=Cannot ${action} ${type}. Max number of cpu 
exceeded
 ACTION_TYPE_FAILED_MAX_NUM_SOCKETS=Cannot ${action} ${type}. Max number of 
sockets exceeded
 VMT_CANNOT_IMPORT_TEMPLATE_EXISTS=Import Template failed - Template Id already 
exist in the system. Please remove the Template (${TemplateName}) from the 
system first
+VMT_CANNOT_IMPORT_TEMPLATE_VERSION_MISSING_BASE=Cannot import Template 
Version, Base Template for this Version is missing, please first Import Base 
Template, or Import Version as Base Template using Clone.
 VM_CANNOT_IMPORT_TEMPLATE_NAME_EXISTS=Import Template failed - Template Name 
already exist in the system. Please rename the Template in the system first
 VM_CANNOT_IMPORT_VM_EXISTS=Import VM failed - VM Id already exist in the 
system. Please remove the VM (${VmName}) from the system first
 VM_CANNOT_IMPORT_VM_NAME_EXISTS=Import VM failed - VM Name already exist in 
the system. Please rename the VM in the system first
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
index b8f66c6..bb4388a 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
@@ -669,6 +669,7 @@
 ACTION_TYPE_FAILED_MAX_NUM_CPU=Cannot ${action} ${type}. Max number of cpu 
exceeded
 ACTION_TYPE_FAILED_MAX_NUM_SOCKETS=Cannot ${action} ${type}. Max number of 
sockets exceeded
 VMT_CANNOT_IMPORT_TEMPLATE_EXISTS=Import Template failed - Template Id already 
exist in the system. Please remove the Template (${TemplateName}) from the 
system first
+VMT_CANNOT_IMPORT_TEMPLATE_VERSION_MISSING_BASE=Cannot import Template 
Version, Base Template for this Version is missing, please first Import Base 
Template, or Import Version as Base Template using Clone.
 VM_CANNOT_IMPORT_TEMPLATE_NAME_EXISTS=Import Template failed - Template Name 
already exist in the system. Please rename the Template in the system first
 VM_CANNOT_IMPORT_VM_EXISTS=Import VM failed - VM Id already exist in the 
system. Please remove the VM (${VmName}) from the system first
 VM_CANNOT_IMPORT_VM_NAME_EXISTS=Import VM failed - VM Name already exist in 
the system. Please rename the VM in the system first


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fbf2c45c03fe9838bf25be5529c93c322372b28
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Omer Frenkel <ofren...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to