Blame SOURCES/bz1346852-03-web-UI-correct-handling-of-timeout-when-removing-mul.patch

15f218
From 900da783cefaa9f8d81ac72bf90b532638ac297b Mon Sep 17 00:00:00 2001
15f218
From: Ondrej Mular <omular@redhat.com>
15f218
Date: Mon, 25 Jul 2016 15:30:49 +0200
15f218
Subject: [PATCH] web UI: correct handling of timeout when removing multiple
15f218
 resources
15f218
15f218
If there are only 2 nodes in cluster (timeout for request is 30 seconds per node)
15f218
and removing resources takes longer then 1 minute, we have no other nodes to try
15f218
remove resources so it will be returned to javascript as there was no response
15f218
from cluster. Now we handle this stituation properly.
15f218
---
15f218
 pcsd/public/js/pcsd.js | 6 +++++-
15f218
 1 file changed, 5 insertions(+), 1 deletion(-)
15f218
15f218
diff --git a/pcsd/public/js/pcsd.js b/pcsd/public/js/pcsd.js
15f218
index e763482..45da010 100644
15f218
--- a/pcsd/public/js/pcsd.js
15f218
+++ b/pcsd/public/js/pcsd.js
15f218
@@ -1291,7 +1291,11 @@ function remove_resource(ids, force) {
15f218
     error: function (xhr, status, error) {
15f218
       error = $.trim(error);
15f218
       var message = "";
15f218
-      if (status == "timeout" || error == "timeout") {
15f218
+      if (
15f218
+        status == "timeout" ||
15f218
+        error == "timeout" ||
15f218
+        xhr.responseText == '{"noresponse":true}'
15f218
+      ) {
15f218
         message = "Operation takes longer to complete than expected.";
15f218
       } else {
15f218
         message = "Unable to remove resources (" + error + ")";
15f218
-- 
15f218
1.8.3.1
15f218