ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-12868. Improve calls to the localStorage (onechiporenko)
Date Tue, 25 Aug 2015 13:21:53 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk bba679959 -> 9b3fff2fc


AMBARI-12868. Improve calls to the localStorage (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 9b3fff2fc1fff130633f577b8429281c824baa82
Parents: bba6799
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Tue Aug 25 16:16:55 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Tue Aug 25 16:21:43 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/installer.js                   | 4 ++--
 ambari-web/app/controllers/main/host/add_controller.js    | 2 +-
 ambari-web/app/controllers/main/service/add_controller.js | 5 +++--
 ambari-web/app/controllers/wizard.js                      | 2 +-
 ambari-web/app/controllers/wizard/step7_controller.js     | 8 ++++----
 ambari-web/app/utils/db.js                                | 8 +++-----
 6 files changed, 14 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b3fff2f/ambari-web/app/controllers/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js
index d1104a7..3e97c4f 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -426,7 +426,7 @@ App.InstallerController = App.WizardController.extend({
   loadMasterComponentHosts: function () {
     var props = this.getDBProperties(['masterComponentHosts', 'hosts']);
     var masterComponentHosts = props.masterComponentHosts,
-      hosts = props.hosts,
+      hosts = props.hosts || {},
       host_names = Em.keys(hosts);
     if (Em.isNone(masterComponentHosts)) {
       masterComponentHosts = [];
@@ -458,7 +458,7 @@ App.InstallerController = App.WizardController.extend({
   loadSlaveComponentHosts: function () {
     var props = this.getDBProperties(['slaveComponentHosts', 'hosts']);
     var slaveComponentHosts = props.slaveComponentHosts,
-      hosts = props.hosts,
+      hosts = props.hosts || {},
       host_names = Em.keys(hosts);
     if (!Em.isNone(slaveComponentHosts)) {
       slaveComponentHosts.forEach(function (component) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b3fff2f/ambari-web/app/controllers/main/host/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/add_controller.js b/ambari-web/app/controllers/main/host/add_controller.js
index d72b146..7f02c25 100644
--- a/ambari-web/app/controllers/main/host/add_controller.js
+++ b/ambari-web/app/controllers/main/host/add_controller.js
@@ -144,7 +144,7 @@ App.AddHostController = App.WizardController.extend({
    var props = this.getDBProperties(['slaveComponentHosts', 'hosts']);
     var slaveComponentHosts = props.slaveComponentHosts || [];
     if (slaveComponentHosts.length) {
-      var hosts = props.hosts,
+      var hosts = props.hosts || {},
           host_names = Em.keys(hosts);
       slaveComponentHosts.forEach(function (component) {
         component.hosts.forEach(function (host) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b3fff2f/ambari-web/app/controllers/main/service/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js
index 79d3e87..1bc293d 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -322,8 +322,9 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs,
{
    * Load master component hosts data for using in required step controllers
    */
   loadSlaveComponentHosts: function () {
-    var slaveComponentHosts = this.getDBProperty('slaveComponentHosts'),
-      hosts = this.getDBProperty('hosts'),
+    var props = this.getDBProperties(['slaveComponentHosts', 'hosts']);
+    var slaveComponentHosts = props.slaveComponentHosts,
+      hosts = props.hosts || {},
       host_names = Em.keys(hosts);
     if (!Em.isNone(slaveComponentHosts)) {
       slaveComponentHosts.forEach(function (component) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b3fff2f/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index fa7375f..0caadeb 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -679,7 +679,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
   loadServiceConfigGroups: function () {
     var props = this.getDBProperties(['serviceConfigGroups', 'hosts']);
     var serviceConfigGroups = props.serviceConfigGroups,
-      hosts = props.hosts,
+      hosts = props.hosts || {},
       host_names = Em.keys(hosts);
     if (Em.isNone(serviceConfigGroups)) {
       serviceConfigGroups = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b3fff2f/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 539fb2e..67c5ecc 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -565,11 +565,11 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin,
App.E
    * @method resolveStormConfigs
    */
   resolveStormConfigs: function (configs) {
-    var props = this.get('wizardController').getDBProperties(['masterComponentHosts', 'hosts']);
-    var dependentConfigs, gangliaServerHost, gangliaHostId,
-      masterComponentHosts = props.masterComponentHosts,
-      hosts = props.hosts;
+    var dependentConfigs, gangliaServerHost, gangliaHostId;
     dependentConfigs = ['nimbus.childopts', 'supervisor.childopts', 'worker.childopts'];
+    var props = this.get('wizardController').getDBProperties(['masterComponentHosts', 'hosts']);
+    var masterComponentHosts = props.masterComponentHosts;
+    var hosts = props.hosts;
     // if Ganglia selected or installed, set ganglia host to configs
     if (this.get('installedServiceNames').contains('STORM') && this.get('installedServiceNames').contains('GANGLIA'))
return;
     if (this.get('allSelectedServiceNames').contains('GANGLIA') || this.get('installedServiceNames').contains('GANGLIA'))
{

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b3fff2f/ambari-web/app/utils/db.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index 6d044f2..495f360 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -145,11 +145,9 @@ App.db.getProperties = function (namespace, listOfProperties) {
     App.db.data[namespace] = {};
   }
   var ret = {};
-  for (var k in listOfProperties) {
-    if (listOfProperties.hasOwnProperty(k)) {
-      ret[k] = App.db.data[namespace][k];
-    }
-  }
+  listOfProperties.forEach(function (k) {
+    ret[k] = App.db.data[namespace][k];
+  });
   return ret;
 };
 


Mime
View raw message