summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@sheep.art.pl>2013-10-10 11:13:49 +0200
committerRadomir Dopieralski <openstack@sheep.art.pl>2013-10-10 14:07:34 +0200
commitec6fbe073a9f53c51417479f10aefdd4b85ef9c3 (patch)
treee9bbef15faed72b5ccd17c9c049dd5dd8e5c0e40
parent177d972960beaa306f31b35060e4f73ea6b00c77 (diff)
downloadtuskar-ui-ec6fbe073a9f53c51417479f10aefdd4b85ef9c3.tar.gz
Fix error handling in provision button ajax call
The check for provisioning status that is needed to show or hide the provision button had broken error handling. Change-Id: I78c7278870d3fdebb7b23de9144ae85136ac4328
-rw-r--r--tuskar_ui/infrastructure/resource_management/templates/resource_management/_provision_info.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/tuskar_ui/infrastructure/resource_management/templates/resource_management/_provision_info.html b/tuskar_ui/infrastructure/resource_management/templates/resource_management/_provision_info.html
index c8cfd82e..3fb8e0aa 100644
--- a/tuskar_ui/infrastructure/resource_management/templates/resource_management/_provision_info.html
+++ b/tuskar_ui/infrastructure/resource_management/templates/resource_management/_provision_info.html
@@ -32,7 +32,7 @@ var provisioning_state_initialized;
var error_html = '<div class="alert alert-block alert-error"><a href="#" class="close" data-dismiss="alert">×</a>{% filter escapejs %}{% trans "Provisioning state unavailable." %}{% endfilter %}</div>';
var check_state = function () {
- $.getJSON(url, function(data) {
+ $.getJSON(url).done(function(data) {
var new_state = data['state'];
if (old_state === new_state) {
// Nothing to see here, move along.
@@ -46,7 +46,10 @@ var provisioning_state_initialized;
divs.html(success_html);
};
old_state = new_state;
- }).fail(function() { element.html(error_html); });
+ }).fail(function(jqxhr, textStatus, error) {
+ window.clearInterval(interval_id);
+ divs.html(error_html);
+ });
};
if (old_state == 'provisioning') {