ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [04/50] [abbrv] ambari git commit: AMBARI-14352. EU/RU: add error handler for 'Pause upgrade'.(xiwang)
Date Fri, 08 Jan 2016 18:15:21 GMT
AMBARI-14352. EU/RU: add error handler for 'Pause upgrade'.(xiwang)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4ec1f0e93c332f3c5817a6c20fe1d8220d4e51f9
Parents: 6ad6d44
Author: Xi Wang <xiwang@apache.org>
Authored: Fri Dec 18 16:32:57 2015 -0800
Committer: Xi Wang <xiwang@apache.org>
Committed: Tue Jan 5 11:22:22 2016 -0800

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js   | 19 ++++++++++++++++++-
 ambari-web/app/messages.js                       |  2 ++
 2 files changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4ec1f0e9/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index d17776f..f80c5ea 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -558,10 +558,27 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       sender: this,
       data: {
         upgradeId: this.get('upgradeId')
-      }
+      },
+      error: 'abortUpgradeErrorCallback'
     });
   },
 
+  /**
+   * error callback of <code>abortUpgrade()</code>
+   * @param {object} data
+   */
+  abortUpgradeErrorCallback: function (data) {
+    var header = Em.I18n.t('admin.stackUpgrade.state.paused.fail.header');
+    var body = Em.I18n.t('admin.stackUpgrade.state.paused.fail.body');
+    if(data && data.responseText){
+      try {
+        var json = $.parseJSON(data.responseText);
+        body = body + ' ' + json.message;
+      } catch (err) {}
+    }
+    App.showAlertPopup(header, body);
+  },
+
   retryUpgrade: function () {
     this.setProperties({
       requestInProgress: true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ec1f0e9/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d36592f..f77901d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1477,6 +1477,8 @@ Em.I18n.translations = {
   'admin.stackVersions.version.downgrade.running': "Downgrade: In Process",
   'admin.stackVersions.version.downgrade.aborted': "Downgrade: Aborted",
   'admin.stackVersions.version.downgrade.suspended': "Downgrade: Paused",
+  'admin.stackUpgrade.state.paused.fail.header': "Pause Upgrade failed",
+  'admin.stackUpgrade.state.paused.fail.body': "Upgrade could not be paused. Try again later.",
 
   'admin.stackVersions.version.upgrade.upgradeOptions.header': "Upgrade Options",
   'admin.stackVersions.version.upgrade.upgradeOptions.bodyMsg.version': "You are about to
perform an upgrade to <b>{0}</b>.",


Mime
View raw message