Yaniv Bronhaim has uploaded a new change for review.

Change subject: core: Return specific provider authentication error
......................................................................

core: Return specific provider authentication error

Change-Id: Ia8d6540b115454cfd2aa055ba711694f74855164
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
M backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/VdsmErrors.java
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
6 files changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/79/31179/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
index 7a282f8..9a72194 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/provider/foreman/ForemanHostProviderProxy.java
@@ -343,10 +343,12 @@
         try {
             int result = httpClient.executeMethod(httpMethod);
 
+            if (result == HttpURLConnection.HTTP_UNAUTHORIZED) {
+                throw new 
VdcBLLException(VdcBllErrors.PROVIDER_AUTHENTICATION_FAILURE);
+            }
+
             // after post request the return value is HTTP_MOVED_TEMP on 
success
             if (result != HttpURLConnection.HTTP_OK && result != 
HttpURLConnection.HTTP_MOVED_TEMP) {
-                // check other results and report better.
-                // 422: conflicts in data
                 throw new VdcBLLException(VdcBllErrors.PROVIDER_FAILURE);
             }
         } catch (HttpException e) {
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
index 382ca11..c02dd36 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllErrors.java
@@ -435,6 +435,7 @@
     FAILED_UPDATE_RUNNING_VM(5053),
     VM_NOT_QUALIFIED_FOR_SNAPSHOT_MERGE(5054),
     VM_HOST_CANNOT_LIVE_MERGE(5055),
+    PROVIDER_AUTHENTICATION_FAILURE(5056),
 
     // Network Labels
     LABELED_NETWORK_INTERFACE_NOT_FOUND(5200),
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 b4c978a..f7c2c3e 100644
--- 
a/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
+++ 
b/backend/manager/modules/dal/src/main/resources/bundles/VdsmErrors.properties
@@ -389,6 +389,7 @@
 PROVIDER_FAILURE=Failed to communicate with the external provider.
 PROVIDER_IMPORT_CERTIFICATE_CHAIN_ERROR=Failed to import provider certificate 
chain.
 PROVIDER_SSL_FAILURE=SSL problem while trying to connect to the external 
provider.
+PROVIDER_AUTHENTICATION_FAILURE=Failed to authenticate with the external 
provider. Please confirm username and passowrd.
 FAILED_UPDATE_RUNNING_VM=Failed to update VM while it is running, please try 
again when the VM is Down.
 VM_NOT_QUALIFIED_FOR_SNAPSHOT_MERGE=To merge snapshots, a VM must be Down, Up 
or Paused.
 VM_HOST_CANNOT_LIVE_MERGE=The host on which this VM is running does not 
support live merging snapshots.
diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/VdsmErrors.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/VdsmErrors.java
index 04cc904..324c608 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/VdsmErrors.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/VdsmErrors.java
@@ -649,6 +649,8 @@
 
     String PROVIDER_SSL_FAILURE();
 
+    String PROVIDER_AUTHENTICATION_FAILURE();
+
     String FAILED_UPDATE_RUNNING_VM();
 
     String PROVIDER_IMPORT_CERTIFICATE_CHAIN_ERROR();
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 a8a7e65..f75ac38 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
@@ -323,6 +323,7 @@
 PROVIDER_FAILURE=Failed to communicate with the external provider.
 PROVIDER_IMPORT_CERTIFICATE_CHAIN_ERROR=Failed to import provider certificate 
chain.
 PROVIDER_SSL_FAILURE=SSL problem while trying to connect to the external 
provider.
+PROVIDER_AUTHENTICATION_FAILURE=Failed to authenticate with the external 
provider. Please confirm username and passowrd.
 FAILED_UPDATE_RUNNING_VM=Failed to update VM while it is running, please try 
again when the VM is Down.
 VM_NOT_QUALIFIED_FOR_SNAPSHOT_MERGE=To merge snapshots, a VM must be Down, Up 
or Paused.
 VM_HOST_CANNOT_LIVE_MERGE=The host on which this VM is running does not 
support live merging snapshots.
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 148fae6..a8569a9 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
@@ -323,6 +323,7 @@
 PROVIDER_FAILURE=Failed to communicate with the external provider.
 PROVIDER_IMPORT_CERTIFICATE_CHAIN_ERROR=Failed to import provider certificate 
chain.
 PROVIDER_SSL_FAILURE=SSL problem while trying to connect to the external 
provider.
+PROVIDER_AUTHENTICATION_FAILURE=Failed to authenticate with the external 
provider. Please confirm username and passowrd.
 FAILED_UPDATE_RUNNING_VM=Failed to update VM while it is running, please try 
again when the VM is Down.
 VM_NOT_QUALIFIED_FOR_SNAPSHOT_MERGE=To merge snapshots, a VM must be Down, Up 
or Paused.
 VM_HOST_CANNOT_LIVE_MERGE=The host on which this VM is running does not 
support live merging snapshots.


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

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

Reply via email to