Updated Branches:
  refs/heads/4.2 7d303d986 -> c4905eafd

Fixing UCS HTTPS redirect


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c4905eaf
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c4905eaf
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c4905eaf

Branch: refs/heads/4.2
Commit: c4905eafd55f7b5171ef5f089d33f94e8db1a09f
Parents: 7d303d9
Author: amogh.vasekar <[email protected]>
Authored: Thu Oct 17 16:10:38 2013 -0700
Committer: Frank.Zhang <[email protected]>
Committed: Fri Oct 18 14:21:14 2013 -0700

----------------------------------------------------------------------
 .../ucs/src/com/cloud/ucs/manager/UcsHttpClient.java            | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c4905eaf/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsHttpClient.java
----------------------------------------------------------------------
diff --git 
a/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsHttpClient.java 
b/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsHttpClient.java
index d3dd483..5bbec66 100755
--- a/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsHttpClient.java
+++ b/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsHttpClient.java
@@ -59,7 +59,7 @@ public class UcsHttpClient {
         ResponseEntity<String> rsp = template.exchange(uri, HttpMethod.POST, 
req, String.class);
         if (rsp.getStatusCode() == org.springframework.http.HttpStatus.OK) {
             return rsp.getBody();
-        } else if (rsp.getStatusCode().value() == 302) {
+        } else if (rsp.getStatusCode() == 
org.springframework.http.HttpStatus.FOUND) {
             // Handle HTTPS redirect
             // Ideal way might be to configure from add manager API
             // for using either HTTP / HTTPS
@@ -68,7 +68,8 @@ public class UcsHttpClient {
             if (location == null) {
                 throw new CloudRuntimeException("Call failed: Bad redirect 
from UCS Manager");
             }
-            call(location, body);
+            //call(location, body);
+            rsp = template.exchange(location, HttpMethod.POST, req, 
String.class);
         }
         if (rsp.getStatusCode() != org.springframework.http.HttpStatus.OK) {
             String err = String.format("http status: %s, response body:%s", 
rsp.getStatusCode().toString(), rsp.getBody());

Reply via email to