Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Warn user if KeystoneAuthUrl wasn't configured
......................................................................

webadmin: Warn user if KeystoneAuthUrl wasn't configured

When testing the connection of a provider that was marked as "Requires
Authentication", I added a check whether the KeystoneAuthUrl was
configured in case the test failed. If it wasn't, the user is hinted
that this might be the cause of the failure.

Change-Id: Ie7c0a8586b4845efbee0d599b31d92ce8158d336
Bug-Url: https://bugzilla.redhat.com/1017538
Signed-off-by: Lior Vernia <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/provider/ProviderPopupView.ui.xml
4 files changed, 16 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/20/25720/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
index b0310ab..c8efbbe 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
@@ -117,7 +117,8 @@
     DefaultMaximumMigrationDowntime,
     IsMigrationSupported(ConfigAuthType.User),
     IsMemorySnapshotSupported(ConfigAuthType.User),
-    IsSuspendSupported(ConfigAuthType.User);
+    IsSuspendSupported(ConfigAuthType.User),
+    KeystoneAuthUrl;
 
     public static enum ConfigAuthType {
         Admin,
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
index c079d99..74f755e 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/providers/ProviderModel.java
@@ -13,6 +13,8 @@
 import org.ovirt.engine.core.common.businessentities.ProviderType;
 import org.ovirt.engine.core.common.businessentities.TenantProviderProperties;
 import org.ovirt.engine.core.common.errors.VdcBllErrors;
+import org.ovirt.engine.core.common.queries.ConfigurationValues;
+import org.ovirt.engine.core.compat.StringHelper;
 import org.ovirt.engine.ui.frontend.AsyncQuery;
 import org.ovirt.engine.ui.frontend.Frontend;
 import org.ovirt.engine.ui.frontend.INewAsyncCallback;
@@ -45,6 +47,9 @@
     private static final String CMD_IMPORT_CHAIN = "ImportChain"; //$NON-NLS-1$
     private static final String CMD_CANCEL_IMPORT = "CancelImport"; 
//$NON-NLS-1$
     private static final String EMPTY_ERROR_MESSAGE = ""; //$NON-NLS-1$
+
+    private final String keystoneUrl =
+            (String) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.KeystoneAuthUrl);
 
     protected final SearchableListModel sourceListModel;
     private final VdcActionType action;
@@ -411,10 +416,10 @@
 
     private void setTestResultValue(VdcReturnValueBase result) {
         String errorMessage = EMPTY_ERROR_MESSAGE;
-        if (result == null) {
-            errorMessage = 
ConstantsManager.getInstance().getConstants().testFailedUnknownErrorMsg();
-        } else if (!result.getSucceeded()) {
-            if (result.getFault() != null) {
+        if (result == null || !result.getSucceeded()) {
+            if ((Boolean) requiresAuthentication.getEntity() && 
StringHelper.isNullOrEmpty(keystoneUrl)) {
+                errorMessage = 
ConstantsManager.getInstance().getConstants().noAuthUrl();
+            } else if (result != null) {
                 errorMessage = 
Frontend.getInstance().translateVdcFault(result.getFault());
             } else {
                 errorMessage = 
ConstantsManager.getInstance().getConstants().testFailedUnknownErrorMsg();
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
index 17975cd..3cdb004 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
@@ -2006,6 +2006,9 @@
     @DefaultStringValue("Change Provider URL")
     String providerUrlWarningTitle();
 
+    @DefaultStringValue("No authentication URL found; please configure one 
using the 'engine-config' utility, then restart the engine service.")
+    String noAuthUrl();
+
     @DefaultStringValue("Import Networks")
     String importNetworksTitle();
 
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/provider/ProviderPopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/provider/ProviderPopupView.ui.xml
index 7a3c3c1..b8ca178 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/provider/ProviderPopupView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/provider/ProviderPopupView.ui.xml
@@ -30,13 +30,13 @@
 
                .testResultImage {
                        float: left;
-                       vertical-align: middle;
                        margin-left: 3px;
                }
 
                .testResultMessage {
                        float: left;
-                       vertical-align: middle;
+                       display: inline-block;
+                       width: 450px;
                        margin-left: 5px;
                        font-size: 8pt;
                }


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

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

Reply via email to