Greg Padgett has uploaded a new change for review.

Change subject: core: fix error message when adding unreachable SD (#853044)
......................................................................

core: fix error message when adding unreachable SD (#853044)

https://bugzilla.redhat.com/853044

The error message when adding an SD to a host that couldn't reach it was
"Internal oVirt engine error".  This improves the message by both
propagating the actual error through the backend, and generalzes the
message wording so the solution is accurate in this case.

Change-Id: Ia1007ce4678576181563f77e39bd8b83b8dd0752
Signed-off-by: Greg Padgett <gpadg...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java
M backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
M 
frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
M 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
4 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/7968/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java
index 9483c51..8f32c6a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java
@@ -6,6 +6,7 @@
 import org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase;
 import org.ovirt.engine.core.common.action.StoragePoolWithStoragesParameter;
 import org.ovirt.engine.core.common.action.VdcActionType;
+import org.ovirt.engine.core.common.action.VdcReturnValueBase;
 import org.ovirt.engine.core.common.businessentities.storage_domain_static;
 import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
 import org.ovirt.engine.core.common.businessentities.StorageDomainType;
@@ -50,11 +51,15 @@
                         getParameters().getSessionId());
                 parameters.setIsInternal(true);
                 
parameters.setTransactionScopeOption(TransactionScopeOption.Suppress);
-                
setSucceeded(getBackend().runInternalAction(VdcActionType.AddStoragePoolWithStorages,
-                        parameters,
-                        new CommandContext(getCompensationContext()))
-                        .getSucceeded());
 
+                VdcReturnValueBase returnValue = 
getBackend().runInternalAction(
+                        VdcActionType.AddStoragePoolWithStorages,
+                        parameters,
+                        new CommandContext(getCompensationContext()));
+                setSucceeded(returnValue.getSucceeded());
+                if (!returnValue.getSucceeded()) {
+                    getReturnValue().setFault(returnValue.getFault());
+                }
             } else {
                 map = getStoragePoolIsoMapDAO().get(new 
StoragePoolIsoMapId(getStorageDomain().getId(),
                         getParameters().getStoragePoolId()));
diff --git 
a/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties 
b/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
index 51ef906..2e6c1ac 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
@@ -45,7 +45,7 @@
 StorageDomainCreationError=Error creating a storage domain
 StorageDomainDeactivateError=Error deactivating storage domain
 StorageDomainDetachError=Error detaching storage domain
-StorageDomainDoesNotExist=Storage domain cannot be reached from the selected 
Host. Try to select another Host.
+StorageDomainDoesNotExist=Storage domain cannot be reached. Please ensure it 
is accessible from the host(s).
 StorageDomainFormatError=Error formatting a storage domain
 StorageDomainNotEmpty=Error in creating a Storage Domain. The selected storage 
path is not empty (probably contains another Storage Domain). Either remove the 
existing Storage Domain from this path, or change the Storage path).
 StorageDomainFSNotMounted=Storage domain remote path not mounted
diff --git 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
index 70290a1..14e0aaa 100644
--- 
a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
+++ 
b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
@@ -45,7 +45,7 @@
 StorageDomainCreationError=Error creating a storage domain
 StorageDomainDeactivateError=Error deactivating storage domain
 StorageDomainDetachError=Error detaching storage domain
-StorageDomainDoesNotExist=Storage domain cannot be reached from the selected 
Host. Try to select another Host.
+StorageDomainDoesNotExist=Storage domain cannot be reached. Please ensure it 
is accessible from the host(s).
 StorageDomainFormatError=Error formatting a storage domain
 StorageDomainNotEmpty=Error in creating a Storage Domain. The selected storage 
path is not empty (probably contains another Storage Domain). Either remove the 
existing Storage Domain from this path, or change the Storage path).
 StorageDomainFSNotMounted=Storage domain remote path not mounted
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
index 70290a1..14e0aaa 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/VdsmErrors.properties
@@ -45,7 +45,7 @@
 StorageDomainCreationError=Error creating a storage domain
 StorageDomainDeactivateError=Error deactivating storage domain
 StorageDomainDetachError=Error detaching storage domain
-StorageDomainDoesNotExist=Storage domain cannot be reached from the selected 
Host. Try to select another Host.
+StorageDomainDoesNotExist=Storage domain cannot be reached. Please ensure it 
is accessible from the host(s).
 StorageDomainFormatError=Error formatting a storage domain
 StorageDomainNotEmpty=Error in creating a Storage Domain. The selected storage 
path is not empty (probably contains another Storage Domain). Either remove the 
existing Storage Domain from this path, or change the Storage path).
 StorageDomainFSNotMounted=Storage domain remote path not mounted


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1007ce4678576181563f77e39bd8b83b8dd0752
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadg...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to