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 Thu, 30 Jun 2016 15:46:53 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk db798a76c -> 15ecedfdc


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/15ecedfd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/15ecedfd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/15ecedfd

Branch: refs/heads/trunk
Commit: 15ecedfdca4907166d9e07a1224271818bbdb8ba
Parents: db798a7
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Jun 30 17:45:56 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Thu Jun 30 17:46:06 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/15ecedfd/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 5d461c7..dcf0426 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2491,6 +2491,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/15ecedfd/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/15ecedfd/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 ebef6e6..8ef4bf4 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -206,6 +206,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}
    */
@@ -335,9 +341,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/15ecedfd/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 62d04f1..eae1f8e 100644
--- a/ambari-web/test/views/main/host/summary_test.js
+++ b/ambari-web/test/views/main/host/summary_test.js
@@ -662,4 +662,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