You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/03/30 19:05:27 UTC

[1/3] ambari git commit: AMBARI-10276. Install wizard (step 3): Removing hosts during bootstrap, will case unexpected behaviour (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 8c237ec86 -> 03f96b251


AMBARI-10276. Install wizard (step 3): Removing hosts during bootstrap, will case unexpected behaviour (alexantonenko)


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

Branch: refs/heads/trunk
Commit: d75309a7b98f8f68c227514f2109003a9efa7f40
Parents: 8c237ec
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Mar 30 19:54:19 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Mar 30 19:54:19 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard/step3_controller.js | 14 +++++++-------
 ambari-web/app/templates/wizard/step3.hbs             | 12 +++++++-----
 ambari-web/test/controllers/wizard/step3_test.js      |  9 ++++-----
 3 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d75309a7/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index 1a6ebe5..4c56afa 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -68,7 +68,9 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
    * is Retry button disabled
    * @type {bool}
    */
-  isRetryDisabled: true,
+  isRetryDisabled: function() {
+    return (this.get('isBackDisabled')) ? this.get('isBackDisabled') : !this.get('bootHosts').filterProperty('bootStatus', 'FAILED').length;
+  }.property('bootHosts.@each.bootStatus', 'isBackDisabled'),
 
   /**
    * Is Back button disabled
@@ -216,7 +218,6 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
     this.set('registrationStartedAt', null);
     this.set('isLoaded', false);
     this.set('isSubmitDisabled', true);
-    this.set('isRetryDisabled', true);
     this.set('stopChecking', false);
   },
 
@@ -235,10 +236,10 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
     });
     App.router.get(this.get('content.controllerName')).launchBootstrap(bootStrapData, function (requestId) {
       if (requestId == '0') {
-        var controller = App.router.get(App.clusterStatus.wizardControllerName);
-        controller.registerErrPopup(Em.I18n.t('common.information'), Em.I18n.t('installer.step2.evaluateStep.hostRegInProgress'));
+        self.startBootstrap();
       } else if (requestId) {
         self.set('content.installOptions.bootRequestId', requestId);
+        App.router.get(self.get('content.controllerName')).save('installOptions');
         self.startBootstrap();
       }
     });
@@ -325,7 +326,8 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
    * @method removeHost
    */
   removeHost: function (hostInfo) {
-    this.removeHosts([hostInfo]);
+    if (!this.get('isBackDisabled'))
+      this.removeHosts([hostInfo]);
   },
 
   /**
@@ -412,7 +414,6 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
    */
   retrySelectedHosts: function () {
     if (!this.get('isRetryDisabled')) {
-      this.set('isRetryDisabled', true);
       var selectedHosts = this.get('bootHosts').filterProperty('bootStatus', 'FAILED');
       selectedHosts.forEach(function (_host) {
         _host.set('bootStatus', 'DONE');
@@ -1214,7 +1215,6 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
    */
   stopRegistration: function () {
     this.set('isSubmitDisabled', !this.get('bootHosts').someProperty('bootStatus', 'REGISTERED'));
-    this.set('isRetryDisabled', !this.get('bootHosts').someProperty('bootStatus', 'FAILED'));
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/d75309a7/ambari-web/app/templates/wizard/step3.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step3.hbs b/ambari-web/app/templates/wizard/step3.hbs
index cb75709..b34c64d 100644
--- a/ambari-web/app/templates/wizard/step3.hbs
+++ b/ambari-web/app/templates/wizard/step3.hbs
@@ -24,10 +24,12 @@
   <div class="box">
     <div class="box-header">
       <div class="button-section">
-        <button class="btn btn-primary step3-remove-selected-btn" {{bindAttr disabled="view.noHostsSelected"}}
-          {{action removeSelectedHosts target="controller" }}><i class="icon-trash icon-white"></i>
-          {{t installer.step3.removeSelected}}
-        </button>
+        {{#unless isBackDisabled}}
+          <button class="btn btn-primary step3-remove-selected-btn" {{bindAttr disabled="view.noHostsSelected"}}
+            {{action removeSelectedHosts target="controller" }}><i class="icon-trash icon-white"></i>
+            {{t installer.step3.removeSelected}}
+          </button>
+        {{/unless}}
         {{#unless isRetryDisabled}}
           <a class="btn btn-primary decommission"
              href="#" {{action retrySelectedHosts target="view"}}><i class="icon-repeat icon-white"></i>
@@ -91,7 +93,7 @@
                    data-toggle="modal" {{action hostLogPopup host target="controller"}}><span {{bindAttr class="host.bootStatusColor"}}>{{host.bootStatusForDisplay}}</span></a>
               </td>
               <td class="step3-table-action">
-                <a class="btn btn-mini" {{action remove target="view"}}><i class="icon-trash"></i>
+                <a class="btn btn-mini" {{action remove target="view"}}{{bindAttr disabled="isBackDisabled"}}><i class="icon-trash"></i>
                   {{t common.remove}}</a>
                 {{#if view.isRetryable}}<a class="btn btn-mini" {{action retry target="view"}}><i
                     class="icon-repeat"></i>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d75309a7/ambari-web/test/controllers/wizard/step3_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step3_test.js b/ambari-web/test/controllers/wizard/step3_test.js
index af7b9e4..e15620d 100644
--- a/ambari-web/test/controllers/wizard/step3_test.js
+++ b/ambari-web/test/controllers/wizard/step3_test.js
@@ -1083,28 +1083,28 @@ describe('App.WizardStep3Controller', function () {
           Em.Object.create({bootStatus: 'REGISTERED'}),
           Em.Object.create({bootStatus: 'RUNNING'})
         ],
-        e: {isSubmitDisabled: false, isRetryDisabled: true}
+        e: {isSubmitDisabled: false}
       },
       {
         bootHosts: [
           Em.Object.create({bootStatus: 'FAILED'}),
           Em.Object.create({bootStatus: 'RUNNING'})
         ],
-        e: {isSubmitDisabled: true, isRetryDisabled: false}
+        e: {isSubmitDisabled: true}
       },
       {
         bootHosts: [
           Em.Object.create({bootStatus: 'FAILED'}),
           Em.Object.create({bootStatus: 'REGISTERED'})
         ],
-        e: {isSubmitDisabled: false, isRetryDisabled: false}
+        e: {isSubmitDisabled: false}
       },
       {
         bootHosts: [
           Em.Object.create({bootStatus: 'RUNNING'}),
           Em.Object.create({bootStatus: 'RUNNING'})
         ],
-        e: {isSubmitDisabled: true, isRetryDisabled: true}
+        e: {isSubmitDisabled: true}
       }
     ]);
     tests.forEach(function (test) {
@@ -1112,7 +1112,6 @@ describe('App.WizardStep3Controller', function () {
         c.reopen({bootHosts: test.bootHosts});
         c.stopRegistration();
         expect(c.get('isSubmitDisabled')).to.equal(test.e.isSubmitDisabled);
-        expect(c.get('isRetryDisabled')).to.equal(test.e.isRetryDisabled);
       });
     });
 


[2/3] ambari git commit: AMBARI-10277. Add host wizard (step 2): Host checks spinner missing (alexantonenko)

Posted by al...@apache.org.
AMBARI-10277. Add host wizard (step 2): Host checks spinner missing (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 6fd09d24bf16d8ae76c9acc46df0ee95ffe131a1
Parents: d75309a
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Mar 30 19:58:11 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Mar 30 19:58:11 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard/step3_controller.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6fd09d24/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index 4c56afa..d68059e 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -534,7 +534,8 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
       // Single host : if the only hostname is invalid (data.status == 'ERROR')
       // Multiple hosts : if one or more hostnames are invalid
       // following check will mark the bootStatus as 'FAILED' for the invalid hostname
-      if (data.status == 'ERROR' || data.hostsStatus.length != this.get('bootHosts').length) {
+      var installedHosts = App.Host.find().mapProperty('hostName');
+      if (data.status == 'ERROR' || data.hostsStatus.mapProperty('hostName').removeObjects(installedHosts).length != this.get('bootHosts').length) {
 
         var hosts = this.get('bootHosts');
 


[3/3] ambari git commit: AMBARI-10278. Unable to create alert notification if invalid parameters don't refer to selected method (alexantonenko)

Posted by al...@apache.org.
AMBARI-10278. Unable to create alert notification if invalid parameters don't refer to selected method (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 03f96b2513754e8846d3a093f448bc0054e0d896
Parents: 6fd09d2
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Mar 30 20:00:47 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Mar 30 20:00:47 2015 +0300

----------------------------------------------------------------------
 .../manage_alert_notifications_controller.js    | 15 ++++++++++
 ...anage_alert_notifications_controller_test.js | 30 +++++++++++++++++++-
 2 files changed, 44 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/03f96b25/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
index 995f2ae..b215758 100644
--- a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
+++ b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
@@ -350,6 +350,21 @@ App.ManageAlertNotificationsController = Em.Controller.extend({
           return this.get('controller.inputFields.method.value') === 'EMAIL';
         }.property('controller.inputFields.method.value'),
 
+        clearValidationErrors: function () {
+          var linkedErrorsMap = {
+              EMAIL: ['emailToError', 'emailFromError', 'smtpPortError', 'passwordError'],
+              SNMP: ['portError']
+            },
+            method = this.get('controller.inputFields.method.value');
+          Em.keys(linkedErrorsMap).forEach(function (name) {
+            if (name != method) {
+              linkedErrorsMap[name].forEach(function (key) {
+                this.set(key, false);
+              }, this);
+            }
+          }, this);
+        }.observes('controller.inputFields.method.value'),
+
         nameValidation: function () {
           var newName = this.get('controller.inputFields.name.value').trim();
           var errorMessage = '';

http://git-wip-us.apache.org/repos/asf/ambari/blob/03f96b25/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
index b6cbc39..2b7fc4c 100644
--- a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
+++ b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
@@ -356,7 +356,8 @@ describe('App.ManageAlertNotificationsController', function () {
               global: {},
               allGroups: {},
               SMTPPassword: {},
-              retypeSMTPPassword: {}
+              retypeSMTPPassword: {},
+              method: {}
             }
           }),
           groupSelect: Em.Object.create({
@@ -462,6 +463,33 @@ describe('App.ManageAlertNotificationsController', function () {
 
       });
 
+      describe('#clearValidationErrors', function () {
+
+        var cases = [
+          {
+            method: 'EMAIL',
+            errors: ['portError']
+          },
+          {
+            method: 'SNMP',
+            errors: ['emailToError', 'emailFromError', 'smtpPortError', 'passwordError']
+          }
+        ];
+
+        cases.forEach(function (item) {
+          it(item.method, function () {
+            item.errors.forEach(function (errorName) {
+              view.set(errorName, true);
+            });
+            view.set('controller.inputFields.method.value', item.method);
+            item.errors.forEach(function (errorName) {
+              expect(view.get(errorName)).to.be.false;
+            });
+          });
+        });
+
+      });
+
     });
 
   });