You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2015/07/13 17:06:57 UTC
ambari git commit: Revert "AMBARI-12049. Host can be deleted despite
some required masters are present (alexantonenko)"
Repository: ambari
Updated Branches:
refs/heads/trunk 541a2cf57 -> 9879cea43
Revert "AMBARI-12049. Host can be deleted despite some required masters are present (alexantonenko)"
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9879cea4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9879cea4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9879cea4
Branch: refs/heads/trunk
Commit: 9879cea4309e8673c68b18d61e0a9d103629b495
Parents: 541a2cf
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Jul 13 18:03:39 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Jul 13 18:03:39 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 15 --------
.../test/controllers/main/host/details_test.js | 36 --------------------
2 files changed, 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9879cea4/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index fc9ec95..54e08b8 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -1868,21 +1868,6 @@ App.MainHostDetailsController = Em.Controller.extend({
if (!cInstance.get('isDeletable')) {
container.nonDeletableComponents.push(cInstance.get('displayName'));
}
- // if is deletable, but with cardinality 1+ and is the only instance on server
- if (cInstance.get('isMaster') && cInstance.get('isDeletable')) {
- var displayName = cInstance.get('displayName'),
- componentName = cInstance.get('componentName');
- var stackComponentCount = App.StackServiceComponent.find(componentName).get('minToInstall');
- var installedCount = App.StackServiceComponent.find(componentName).get('isMaster')
- ? App.HostComponent.find().filterProperty('componentName', componentName).length
- : App.SlaveComponent.find().findProperty('componentName', componentName).get('totalCount');
- var isDeleteComponentDisabled = (installedCount <= stackComponentCount)
- || ![App.HostComponentStatus.stopped, App.HostComponentStatus.unknown, App.HostComponentStatus.install_failed, App.HostComponentStatus.upgrade_failed, App.HostComponentStatus.init].contains(self.get('workStatus'));
- if (isDeleteComponentDisabled) {
- if (!container.masterComponents.contains(displayName))
- container.masterComponents.push(displayName);
- }
- }
if (workStatus === App.HostComponentStatus.unknown) {
container.unknownComponents.push(cInstance.get('displayName'));
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/9879cea4/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 513f517..64d52c9 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -1589,42 +1589,6 @@ describe('App.MainHostDetailsController', function () {
expect(controller.getHostComponentsInfo().nonDeletableComponents).to.eql(['ZK1']);
App.HostComponent.find.restore();
});
-
-
- it('content.hostComponents has master deletable with cardinality 1+ and only one installed component', function () {
- sinon.stub(App.HostComponent, 'find', function () {
- return [
- {
- id: 'TASKTRACKER_host1',
- componentName: 'TASKTRACKER'
- }
- ];
- });
- sinon.stub(App.StackServiceComponent, 'find', function (component) {
- return Em.Object.create(
- {
- componentName: 'TASKTRACKER',
- minToInstall: 1,
- isMaster: true
- });
- });
- sinon.stub(App.SlaveComponent, 'find', function () {
- return [];
- });
- controller.set('content', {hostComponents: [Em.Object.create({
- componentName: 'TASKTRACKER',
- workStatus: 'INIT',
- isDeletable: true,
- isMaster: true,
- displayName: 'ZK1'
- })]});
- expect(controller.getHostComponentsInfo().masterComponents.contains('ZK1')).to.be.true;
- App.HostComponent.find.restore();
- App.StackServiceComponent.find.restore();
- App.SlaveComponent.find.restore();
- });
-
-
it('content.hostComponents has running component', function () {
sinon.stub(App.HostComponent, 'find', function () {
return [