ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-17504 If client install fails there is no way to reinstall after fixing the issue in the UI. (akovalenko)
Date Tue, 13 Sep 2016 12:30:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 673f524b1 -> 275d5dffc


AMBARI-17504 If client install fails there is no way to reinstall after fixing the issue in
the UI. (akovalenko)


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

Branch: refs/heads/branch-2.5
Commit: 275d5dffcbbb9ea7976c650bf50f09320e034e8f
Parents: 673f524
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Jun 30 17:45:56 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Tue Sep 13 15:30:29 2016 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  1 +
 ambari-web/app/templates/main/host/summary.hbs  |  7 +++++++
 ambari-web/app/views/main/host/summary.js       | 15 ++++++++++++++-
 ambari-web/test/views/main/host/summary_test.js | 19 +++++++++++++++++++
 4 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/275d5dff/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index c7bab8d..0640916 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2482,6 +2482,7 @@ Em.I18n.translations = {
   'hosts.host.details.for.postfix':'{0} for host',
   'hosts.host.details.setRackId':'Set Rack',
   'host.host.details.installClients': 'Install clients',
+  'host.host.details.reinstallClients': 'Reinstall clients',
 
   'host.host.componentFilter.master':'Master Components',
   'host.host.componentFilter.slave':'Slave Components',

http://git-wip-us.apache.org/repos/asf/ambari/blob/275d5dff/ambari-web/app/templates/main/host/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/summary.hbs b/ambari-web/app/templates/main/host/summary.hbs
index b812f4b..7cf3314 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -95,6 +95,13 @@
                           {{t host.host.details.installClients}}
                         </a>
                       </li>
+                      {{#if view.anyClientFailedToInstall}}
+                        <li>
+                          <a href="javascript:void(null)" {{action reinstallClients target="view"}}>
+                            {{t host.host.details.reinstallClients}}
+                          </a>
+                        </li>
+                      {{/if}}
                       {{#each option in view.clientsWithCustomCommands}}
                         <li class="dropdown-submenu submenu-left">
                           <a href="javascript:void(null)" >

http://git-wip-us.apache.org/repos/asf/ambari/blob/275d5dff/ambari-web/app/views/main/host/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js
index 840b93f..80c4890 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -204,6 +204,12 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, {
   areClientWithStaleConfigs: Em.computed.someBy('clients', 'staleConfigs', true),
 
   /**
+   * List of install failed clients
+   * @type {App.HostComponent[]}
+   */
+  installFailedClients: Em.computed.filterBy('clients', 'workStatus', 'INSTALL_FAILED'),
+
+  /**
    * Template for addable component
    * @type {Em.Object}
    */
@@ -333,9 +339,16 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, {
   }.property('controller'),
 
   /**
-   * Call installClients method from controller for not installed components
+   * Call installClients method from controller for not installed client components
    */
   installClients: function () {
     this.get('controller').installClients(this.get('notInstalledClientComponents'));
+  },
+
+  /**
+   * Call installClients method from controller for not install failed client components
+   */
+  reinstallClients: function () {
+    this.get('controller').installClients(this.get('installFailedClients'));
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/275d5dff/ambari-web/test/views/main/host/summary_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/host/summary_test.js b/ambari-web/test/views/main/host/summary_test.js
index 4c91dea..31b6d94 100644
--- a/ambari-web/test/views/main/host/summary_test.js
+++ b/ambari-web/test/views/main/host/summary_test.js
@@ -675,4 +675,23 @@ describe('App.MainHostSummaryView', function() {
       expect(mainHostSummaryView.get('controller.installClients').calledWith([1,2,3])).to.be.true;
     });
   });
+
+  describe("#reinstallClients()", function () {
+
+    beforeEach(function () {
+      var controller = {installClients: Em.K};
+      sinon.spy(controller, 'installClients');
+      mainHostSummaryView.set('controller', controller);
+      mainHostSummaryView.reopen({'installFailedClients': [1,2,3]});
+    });
+
+    afterEach(function () {
+      mainHostSummaryView.get('controller.installClients').restore();
+    });
+
+    it("should call installClients method from controller", function () {
+      mainHostSummaryView.reinstallClients();
+      expect(mainHostSummaryView.get('controller.installClients').calledWith([1,2,3])).to.be.true;
+    });
+  });
 });


Mime
View raw message