|
@@ -22,7 +22,7 @@ App.KerberosWizardStep3Controller = App.KerberosProgressPageController.extend({
|
|
|
serviceName: 'KERBEROS',
|
|
|
componentName: 'KERBEROS_CLIENT',
|
|
|
ignore: undefined,
|
|
|
-
|
|
|
+ heartBeatLostHosts: [],
|
|
|
commands: ['installKerberos', 'testKerberos'],
|
|
|
|
|
|
loadStep: function () {
|
|
@@ -30,6 +30,11 @@ App.KerberosWizardStep3Controller = App.KerberosProgressPageController.extend({
|
|
|
this.enableDisablePreviousSteps();
|
|
|
},
|
|
|
|
|
|
+ clearStep: function() {
|
|
|
+ this.get('heartBeatLostHosts').clear();
|
|
|
+ this._super();
|
|
|
+ },
|
|
|
+
|
|
|
installKerberos: function() {
|
|
|
var self = this;
|
|
|
this.getKerberosClientState().done(function(data) {
|
|
@@ -52,6 +57,21 @@ App.KerberosWizardStep3Controller = App.KerberosProgressPageController.extend({
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * Get hosts with HEARTBEAT_LOST state.
|
|
|
+ *
|
|
|
+ * @return {$.Deferred.promise} promise
|
|
|
+ */
|
|
|
+ getHeartbeatLostHosts: function() {
|
|
|
+ return App.ajax.send({
|
|
|
+ name: 'hosts.heartbeat_lost',
|
|
|
+ sender: this,
|
|
|
+ data: {
|
|
|
+ clusterName: App.get('clusterName')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
getKerberosClientState: function() {
|
|
|
return App.ajax.send({
|
|
|
name: 'common.service_component.info',
|
|
@@ -116,6 +136,34 @@ App.KerberosWizardStep3Controller = App.KerberosProgressPageController.extend({
|
|
|
if (this.get('showIgnore')) {
|
|
|
this.set('isSubmitDisabled', !this.get('ignore'));
|
|
|
}
|
|
|
- }.observes('ignore', 'showIgnore')
|
|
|
-});
|
|
|
+ }.observes('ignore', 'showIgnore'),
|
|
|
+
|
|
|
+ retryTask: function() {
|
|
|
+ this._super();
|
|
|
+ // retry from the first task (installKerberos) if there is any host in HEARTBEAT_LOST state.
|
|
|
+ if (this.get('heartBeatLostHosts').length) {
|
|
|
+ this.get('tasks').setEach('status', 'PENDING');
|
|
|
+ this.get('tasks').setEach('showRetry', false);
|
|
|
+ this.get('heartBeatLostHosts').clear();
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
+ /**
|
|
|
+ * Check for complete status and determines:
|
|
|
+ * - if there are any hosts in HEARTBEAT_LOST state. In this case warn about hosts and make step FAILED.
|
|
|
+ *
|
|
|
+ * @return {undefined}
|
|
|
+ */
|
|
|
+ statusDidChange: function() {
|
|
|
+ var self = this;
|
|
|
+ if (this.get('completedStatuses').contains(this.get('status'))) {
|
|
|
+ this.getHeartbeatLostHosts().then(function(data) {
|
|
|
+ var hostNames = Em.getWithDefault(data || {}, 'items', []).mapProperty('Hosts.host_name');
|
|
|
+ if (hostNames.length) {
|
|
|
+ self.set('heartBeatLostHosts', hostNames.uniq());
|
|
|
+ self.get('tasks').objectAt(0).set('status', 'FAILED');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }.observes('status')
|
|
|
+});
|