ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-12590 Redundant nimbus.seeds config merge warning among pre-upgrade check results. (atkach)
Date Thu, 30 Jul 2015 15:27:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9552b8649 -> a1e0caedd


AMBARI-12590 Redundant nimbus.seeds config merge warning among pre-upgrade check results.
(atkach)


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

Branch: refs/heads/trunk
Commit: a1e0caedd0acc5da52048286efd39f9d5a02ab59
Parents: 9552b86
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Thu Jul 30 18:27:14 2015 +0300
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Thu Jul 30 18:27:14 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js |  2 +-
 ambari-web/app/data/HDP2.3/site_properties.js   | 11 +++
 ambari-web/app/data/HDP2/site_properties.js     | 11 ---
 .../test/controllers/main/host/details_test.js  | 71 ++++++++++++++++++++
 4 files changed, 83 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a1e0caed/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 6b62bd8..ee96ca0 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -1025,7 +1025,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.ComponentActionsMixin,
    * @method updateStormConfigs
    */
   updateStormConfigs: function () {
-    if (App.Service.find().findProperty('serviceName', 'STORM')) {
+    if (App.Service.find('STORM').get('isLoaded') && App.get('isHadoop23Stack'))
{
       this.loadConfigs("loadStormConfigs");
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1e0caed/ambari-web/app/data/HDP2.3/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2.3/site_properties.js b/ambari-web/app/data/HDP2.3/site_properties.js
index ba09879..1babe76 100644
--- a/ambari-web/app/data/HDP2.3/site_properties.js
+++ b/ambari-web/app/data/HDP2.3/site_properties.js
@@ -401,6 +401,17 @@ hdp23properties.push({
   },
   {
     "id": "site property",
+    "name": "nimbus.seeds",
+    "displayName": "nimbus.seeds",
+    "isReconfigurable": false,
+    "isOverridable": false,
+    "displayType": "masterHosts",
+    "serviceName": "STORM",
+    "filename": "storm-site.xml",
+    "category": "NIMBUS"
+  },
+  {
+    "id": "site property",
     "name": "xasecure.audit.destination.db",
     "displayName": "Audit to DB",
     "displayType": "checkbox",

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1e0caed/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 93ca84f..44833b2 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -1060,17 +1060,6 @@ var hdp2properties = [
   },
   {
     "id": "site property",
-    "name": "nimbus.seeds",
-    "displayName": "nimbus.seeds",
-    "isReconfigurable": false,
-    "isOverridable": false,
-    "displayType": "masterHosts",
-    "serviceName": "STORM",
-    "filename": "storm-site.xml",
-    "category": "NIMBUS"
-  },
-  {
-    "id": "site property",
     "name": "nimbus.thrift.port",
     "displayName": "nimbus.thrift.port",
     "displayType": "int",

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1e0caed/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 e72d8e1..838822c 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -2819,4 +2819,75 @@ describe('App.MainHostDetailsController', function () {
     });
 
   });
+
+  describe("#removeHostComponentModel()", function () {
+    beforeEach(function () {
+      sinon.stub(App.HostComponent, 'find').returns([
+        Em.Object.create({
+          id: 'C1_host1',
+          componentName: 'C1',
+          hostName: 'host1',
+          service: Em.Object.create({
+            serviceName: 'S1'
+          })
+        })
+      ]);
+      sinon.stub(App.serviceMapper, 'deleteRecord', Em.K);
+    });
+    afterEach(function () {
+      App.HostComponent.find.restore();
+      App.serviceMapper.deleteRecord.restore();
+    });
+    it("", function () {
+      App.cache['services'] = [
+        {
+          ServiceInfo: {
+            service_name: 'S1'
+          },
+          host_components: ['C1_host1']
+        }
+      ];
+      controller.removeHostComponentModel('C1', 'host1');
+      expect(App.cache['services'][0].host_components).to.be.empty;
+      expect(App.HostComponent.find.calledOnce).to.be.true;
+      expect(App.serviceMapper.deleteRecord.calledOnce).to.be.true;
+    });
+  });
+
+  describe("#updateStormConfigs()", function () {
+    beforeEach(function () {
+      this.serviceMock = sinon.stub(App.Service, 'find');
+      sinon.stub(controller, 'loadConfigs');
+      this.mock = sinon.stub(App, 'get')
+    });
+    afterEach(function () {
+      this.serviceMock.restore();
+      this.mock.restore();
+      controller.loadConfigs.restore();
+    });
+    it("storm not installed, hadoop stack is 2.2", function () {
+      this.serviceMock.returns(Em.Object.create({
+        isLoaded: false
+      }));
+      this.mock.returns(false);
+      controller.updateStormConfigs();
+      expect(controller.loadConfigs.called).to.be.false;
+    });
+    it("storm installed, hadoop stack is 2.2", function () {
+      this.serviceMock.returns(Em.Object.create({
+        isLoaded: true
+      }));
+      this.mock.returns(false);
+      controller.updateStormConfigs();
+      expect(controller.loadConfigs.called).to.be.false;
+    });
+    it("storm installed, hadoop stack is 2.3", function () {
+      this.serviceMock.returns(Em.Object.create({
+        isLoaded: true
+      }));
+      this.mock.returns(true);
+      controller.updateStormConfigs();
+      expect(controller.loadConfigs.calledWith('loadStormConfigs')).to.be.true;
+    });
+  });
 });


Mime
View raw message