Daniel Erez has uploaded a new change for review. Change subject: core: add disk - storage domain not specified error message ......................................................................
core: add disk - storage domain not specified error message AddDiskCommand -> canDo: added a verification that a storage domain ID has been specified by the client (and return an appropriate error message accordingly). Change-Id: Ibd74f8ecd23b3c01108c31a0bb46f99002fd7071 Bug-Url: https://bugzilla.redhat.com/1120768 Signed-off-by: Daniel Erez <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.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, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/33/30633/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java index 90f7c94..0613f29 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java @@ -166,6 +166,10 @@ } protected boolean checkIfImageDiskCanBeAdded(VM vm, DiskValidator diskValidator) { + if (Guid.Empty.equals(getParameters().getStorageDomainId()) && Guid.Empty.equals(getStorageDomainId())) { + return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED); + } + boolean returnValue; StorageDomainValidator storageDomainValidator = createStorageDomainValidator(); // vm agnostic checks 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 67134bc..04733f2 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 @@ -233,6 +233,7 @@ ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS(ErrorType.BAD_PARAMETERS), ACTION_TYPE_FAILED_STORAGE_DOMAIN_IS_WRONG(ErrorType.BAD_PARAMETERS), ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_CONTAINS_DISK(ErrorType.CONFLICT), + ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED(ErrorType.BAD_PARAMETERS), ACTION_TYPE_FAILED_STORAGE_DELETE_PROTECTED(ErrorType.CONFLICT), ACTION_TYPE_FAILED_STORAGE_VMS_IN_POOL(ErrorType.CONFLICT), ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST(ErrorType.CONFLICT), 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 44e5077..1891e87 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -251,6 +251,7 @@ ACTION_TYPE_FAILED_STORAGE_POOL_NOT_MATCH=Cannot ${action} ${type}. The target Data Center does not contain the ${type}. ACTION_TYPE_FAILED_STORAGE_POOL_OF_VM_NOT_MATCH=Cannot ${action} ${type}. The target Data Center does not contain the Virtual Machine. ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_CONTAINS_DISK=Cannot ${action} ${type}. The Storage Domain already contains the target disk(s). +ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED=Cannot ${action} ${type}. Storage Domain hasn't been specified. ACTION_TYPE_FAILED_STORAGE_DELETE_PROTECTED=Cannot ${action} ${type}. The following VMs/Templates are delete protected: ${vms}. ACTION_TYPE_FAILED_STORAGE_VMS_IN_POOL=Cannot ${action} ${type}. The following VMs/Templates are attached to pool: ${vms}. ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST=Cannot ${action} ${type}. The Storage Domain name is already in use. 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 b01262d..b253aba 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 @@ -679,6 +679,9 @@ @DefaultStringValue("Cannot ${action} ${type}. The Storage Domain already contains the target disk(s).") String ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_CONTAINS_DISK(); + @DefaultStringValue("Cannot ${action} ${type}. Storage Domain hasn't been specified.") + String ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED(); + @DefaultStringValue("Cannot ${action} ${type}. The following VMs/Templates are delete protected: ${vms}.") String ACTION_TYPE_FAILED_STORAGE_DELETE_PROTECTED(); 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 79ab2db..46277c3 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 @@ -242,6 +242,7 @@ ACTION_TYPE_FAILED_STORAGE_POOL_NOT_MATCH=Cannot ${action} ${type}. The target Data Center does not contain the ${type}. ACTION_TYPE_FAILED_STORAGE_POOL_OF_VM_NOT_MATCH=Cannot ${action} ${type}. The target Data Center does not contain the Virtual Machine. ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_CONTAINS_DISK=Cannot ${action} ${type}. The Storage Domain already contains the target disk(s). +ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED=Cannot ${action} ${type}. Storage Domain hasn't been specified. ACTION_TYPE_FAILED_STORAGE_DELETE_PROTECTED=Cannot ${action} ${type}. The following VMs/Templates are delete protected: ${vms}. ACTION_TYPE_FAILED_STORAGE_VMS_IN_POOL=Cannot ${action} ${type}. The following VMs/Templates are attached to pool: ${vms}. ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST=Cannot ${action} ${type}. The Storage Domain name is already in use. 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 e082a63..36fa9c3 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 @@ -249,6 +249,7 @@ ACTION_TYPE_FAILED_STORAGE_POOL_NOT_MATCH=Cannot ${action} ${type}. The target Data Center does not contain the ${type}. ACTION_TYPE_FAILED_STORAGE_POOL_OF_VM_NOT_MATCH=Cannot ${action} ${type}. The target Data Center does not contain the Virtual Machine. ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_CONTAINS_DISK=Cannot ${action} ${type}. The Storage Domain already contains the target disk(s). +ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_SPECIFIED=Cannot ${action} ${type}. Storage Domain hasn't been specified. ACTION_TYPE_FAILED_STORAGE_DELETE_PROTECTED=Cannot ${action} ${type}. The following VMs/Templates are delete protected: ${vms}. ACTION_TYPE_FAILED_STORAGE_VMS_IN_POOL=Cannot ${action} ${type}. The following VMs/Templates are attached to pool: ${vms}. ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST=Cannot ${action} ${type}. The Storage Domain name is already in use. -- To view, visit http://gerrit.ovirt.org/30633 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd74f8ecd23b3c01108c31a0bb46f99002fd7071 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Daniel Erez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
