Browse Source

AMBARI-6549. Fix App.testMode using. (onechiporenko)

Oleg Nechiporenko 11 years ago
parent
commit
cb335d5d7d
46 changed files with 95 additions and 94 deletions
  1. 1 1
      ambari-web/app/controllers/application.js
  2. 1 1
      ambari-web/app/controllers/global/background_operations_controller.js
  3. 5 5
      ambari-web/app/controllers/global/cluster_controller.js
  4. 2 2
      ambari-web/app/controllers/main/admin/cluster.js
  5. 3 3
      ambari-web/app/controllers/main/admin/highAvailability_controller.js
  6. 3 3
      ambari-web/app/controllers/main/admin/security.js
  7. 2 2
      ambari-web/app/controllers/main/admin/security/add/step2.js
  8. 1 1
      ambari-web/app/controllers/main/admin/security/add/step3.js
  9. 1 1
      ambari-web/app/controllers/main/admin/security/add/step4.js
  10. 4 4
      ambari-web/app/controllers/main/admin/security/security_progress_controller.js
  11. 1 1
      ambari-web/app/controllers/main/apps/item_controller.js
  12. 1 1
      ambari-web/app/controllers/main/apps_controller.js
  13. 3 3
      ambari-web/app/controllers/main/host/details.js
  14. 2 2
      ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
  15. 3 3
      ambari-web/app/controllers/main/service/item.js
  16. 2 2
      ambari-web/app/controllers/main/service/reassign_controller.js
  17. 7 7
      ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js
  18. 1 1
      ambari-web/app/controllers/wizard/step2_controller.js
  19. 7 7
      ambari-web/app/controllers/wizard/step3_controller.js
  20. 1 1
      ambari-web/app/controllers/wizard/step8_controller.js
  21. 7 7
      ambari-web/app/controllers/wizard/step9_controller.js
  22. 1 1
      ambari-web/app/models/host.js
  23. 3 3
      ambari-web/app/router.js
  24. 2 2
      ambari-web/app/routes/add_host_routes.js
  25. 3 3
      ambari-web/app/routes/add_security.js
  26. 1 1
      ambari-web/app/routes/add_service_routes.js
  27. 3 3
      ambari-web/app/routes/installer.js
  28. 1 1
      ambari-web/app/utils/host_progress_popup.js
  29. 1 1
      ambari-web/app/utils/jobs.js
  30. 1 1
      ambari-web/app/utils/polling.js
  31. 1 1
      ambari-web/app/views/common/table_view.js
  32. 1 1
      ambari-web/app/views/main/apps/item/bar_view.js
  33. 2 2
      ambari-web/app/views/main/apps/item/dag_view.js
  34. 1 1
      ambari-web/app/views/main/dashboard/widget.js
  35. 4 4
      ambari-web/app/views/main/dashboard/widgets.js
  36. 1 1
      ambari-web/app/views/main/dashboard/widgets/datanode_live.js
  37. 1 1
      ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js
  38. 1 1
      ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js
  39. 1 1
      ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js
  40. 1 1
      ambari-web/app/views/main/dashboard/widgets/jobtracker_rpc.js
  41. 1 1
      ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js
  42. 1 1
      ambari-web/app/views/main/dashboard/widgets/node_managers_live.js
  43. 1 1
      ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
  44. 1 1
      ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js
  45. 2 1
      ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js
  46. 1 1
      ambari-web/app/views/wizard/step8_view.js

+ 1 - 1
ambari-web/app/controllers/application.js

@@ -106,7 +106,7 @@ App.ApplicationController = Em.Controller.extend(App.UserPref, {
             curValue = initValue;
           }
           var key = self.persistKey();
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             self.postUserPref(key, curValue);
           }
           this.hide();

+ 1 - 1
ambari-web/app/controllers/global/background_operations_controller.js

@@ -98,7 +98,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
         'operationsCount': count
       }
     };
-    if (levelInfo.get('name') === 'TASK_DETAILS' && !App.testMode) {
+    if (levelInfo.get('name') === 'TASK_DETAILS' && !App.get('testMode')) {
       result.name = 'background_operations.get_by_task';
       result.successCallback = 'callBackFilteredByTask';
       result.data = {

+ 5 - 5
ambari-web/app/controllers/global/cluster_controller.js

@@ -150,11 +150,11 @@ App.ClusterController = Em.Controller.extend({
   },
 
   getUrl: function (testUrl, url) {
-    return (App.testMode) ? testUrl : App.apiPrefix + '/clusters/' + App.get('clusterName') + url;
+    return (App.get('testMode')) ? testUrl : App.get('apiPrefix') + '/clusters/' + App.get('clusterName') + url;
   },
 
   setGangliaUrl: function () {
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.set('gangliaUrl', 'http://gangliaserver/ganglia/?t=yes');
       this.set('isGangliaUrlLoaded', true);
     } else {
@@ -186,7 +186,7 @@ App.ClusterController = Em.Controller.extend({
   },
 
   setNagiosUrl: function () {
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.set('nagiosUrl', 'http://nagiosserver/nagios');
       this.set('isNagiosUrlLoaded', true);
     } else {
@@ -259,7 +259,7 @@ App.ClusterController = Em.Controller.extend({
       return;
     }
     var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
-    var usersUrl = App.testMode ? '/data/users/users.json' : App.apiPrefix + '/users/?fields=*';
+    var usersUrl = App.get('testMode') ? '/data/users/users.json' : App.get('apiPrefix') + '/users/?fields=*';
     var racksUrl = "/data/racks/racks.json";
 
 
@@ -284,7 +284,7 @@ App.ClusterController = Em.Controller.extend({
       self.updateLoadStatus('cluster');
     });
 
-    if (App.testMode) {
+    if (App.get('testMode')) {
       self.updateLoadStatus('clusterStatus');
     } else {
       App.clusterStatus.updateFromServer().complete(function () {

+ 2 - 2
ambari-web/app/controllers/main/admin/cluster.js

@@ -39,7 +39,7 @@ App.MainAdminClusterController = Em.Controller.extend({
   }.observes('App.router.clusterController.isLoaded', 'App.currentStackVersion', 'App.router.mainServiceController.content.length'),
 
   updateUpgradeVersionSuccessCallback: function (data) {
-    var upgradeVersion = this.get('upgradeVersion') || App.defaultStackVersion;
+    var upgradeVersion = this.get('upgradeVersion') || App.get('defaultStackVersion');
     var currentVersion = App.get('currentStackVersionNumber');
     upgradeVersion = upgradeVersion.replace(/HDP-/, '');
     data.items.mapProperty('Versions.stack_version').forEach(function (version) {
@@ -91,7 +91,7 @@ App.MainAdminClusterController = Em.Controller.extend({
   loadRepositoriesSuccessCallback: function (data) {
     var allRepos = [];
     data.items.forEach(function (os) {
-      if (!App.supports.ubuntu && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation
+      if (!App.get('supports.ubuntu') && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation
       os.repositories.forEach(function (repository) {
         var osType = repository.Repositories.os_type;
         var repo = Em.Object.create({

+ 3 - 3
ambari-web/app/controllers/main/admin/highAvailability_controller.js

@@ -85,12 +85,12 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({
   },
 
   setSecurityStatus: function () {
-    if (App.testMode) {
-      this.set('securityEnabled', !App.testEnableSecurity);
+    if (App.get('testMode')) {
+      this.set('securityEnabled', !App.get('testEnableSecurity'));
       this.set('dataIsLoaded', true);
     } else {
       //get Security Status From Server
-      App.ajax.send({
+      return App.ajax.send({
         name: 'admin.security_status',
         sender: this,
         success: 'getSecurityStatusFromServerSuccessCallback',

+ 3 - 3
ambari-web/app/controllers/main/admin/security.js

@@ -163,7 +163,7 @@ App.MainAdminSecurityController = Em.Controller.extend({
   loadSecurityUsers: function () {
     var securityUsers = this.get('serviceUsers');
     if (!securityUsers || securityUsers.length < 1) { // Page could be refreshed in middle
-      if (App.testMode) {
+      if (App.get('testMode')) {
         securityUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'});
         securityUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'});
         securityUsers.pushObject({id: 'puppet var', name: 'hbase_user', value: 'hbase'});
@@ -241,8 +241,8 @@ App.MainAdminSecurityController = Em.Controller.extend({
   },
 
   setSecurityStatus: function () {
-    if (App.testMode) {
-      this.set('securityEnabled', !App.testEnableSecurity);
+    if (App.get('testMode')) {
+      this.set('securityEnabled', !App.get('testEnableSecurity'));
       this.set('dataIsLoaded', true);
     } else {
       //get Security Status From Server

+ 2 - 2
ambari-web/app/controllers/main/admin/security/add/step2.js

@@ -320,7 +320,7 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({
   loadUsers: function () {
     var securityUsers = App.router.get('mainAdminSecurityController').get('serviceUsers');
     if (Em.isNone(securityUsers) || securityUsers.length === 0) {
-      if (App.testMode) {
+      if (App.get('testMode')) {
         securityUsers = securityUsers || [];
         securityUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'});
         securityUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'});
@@ -404,7 +404,7 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({
     if (hdfsService) {
       var properties = stepConfigs.findProperty('serviceName', 'HDFS').get('configs');
       var configCategories = hdfsService.configCategories;
-      if ((App.testMode && App.testNameNodeHA) || (this.get('content.isNnHa') === 'true')) {
+      if ((App.get('testMode') && App.get('testNameNodeHA')) || (this.get('content.isNnHa') === 'true')) {
         this.removeConfigCategory(properties, configCategories, 'SNameNode');
       } else {
         this.removeConfigCategory(properties, configCategories, 'JournalNode');

+ 1 - 1
ambari-web/app/controllers/main/admin/security/add/step3.js

@@ -385,7 +385,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
    */
   getSecurityUsers: function () {
     var securityUsers = [];
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.get('testModeUsers').forEach(function (user) {
         securityUsers.push({
           id: 'puppet var',

+ 1 - 1
ambari-web/app/controllers/main/admin/security/add/step4.js

@@ -425,7 +425,7 @@ App.MainAdminSecurityAddStep4Controller = App.MainAdminSecurityProgressControlle
    * load users from server
    */
   loadUsersFromServer: function () {
-    if (App.testMode) {
+    if (App.get('testMode')) {
       var serviceUsers = this.get('serviceUsers');
       this.get('testModeUsers').forEach(function (user) {
         user.id = 'puppet var';

+ 4 - 4
ambari-web/app/controllers/main/admin/security/security_progress_controller.js

@@ -158,7 +158,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
           command.start();
         } else if (command.get('name') === 'APPLY_CONFIGURATIONS') {
           command.set('isStarted', true);
-          if (App.testMode) {
+          if (App.get('testMode')) {
             command.set('isError', false);
             command.set('isSuccess', true);
           } else {
@@ -166,7 +166,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
           }
         } else if (command.get('name') === 'DELETE_ATS') {
           command.set('isStarted', true);
-          if (App.testMode) {
+          if (App.get('testMode')) {
             command.set('isError', false);
             command.set('isSuccess', true);
           } else {
@@ -218,7 +218,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
     var urlPrefix = App.apiPrefix + '/clusters/' + App.get('clusterName');
     operationsInfo.forEach(function (operation) {
       var command = this.get('commands').findProperty('name', operation.name);
-      var url = (App.testMode) ? operation.testUrl : urlPrefix + operation.realUrl;
+      var url = (App.get('testMode')) ? operation.testUrl : urlPrefix + operation.realUrl;
       command.set('url', url);
       command.set('data', operation.data);
     }, this);
@@ -408,7 +408,7 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
         commands.pushObject(command);
       }, this);
       App.db.setSecurityDeployCommands(commands);
-      if (!App.testMode) {
+      if (!App.get('testMode')) {
         App.clusterStatus.setClusterStatus({
           clusterName: this.get('clusterName'),
           clusterState: 'ADD_SECURITY_STEP_4',

+ 1 - 1
ambari-web/app/controllers/main/apps/item_controller.js

@@ -34,7 +34,7 @@ App.MainAppsItemController = Em.Controller.extend({
     }
     var self = this;
 
-    var url = App.testMode ? '/data/apps/jobs/'+ currentId +'.json' :
+    var url = App.get('testMode') ? '/data/apps/jobs/'+ currentId +'.json' :
       App.apiPrefix + "/jobhistory/job?workflowId=" + currentId;
 
     var mapper = App.jobsMapper;

+ 1 - 1
ambari-web/app/controllers/main/apps_controller.js

@@ -48,7 +48,7 @@ App.MainAppsController = Em.ArrayController.extend({
     var self = this;
 
     //var runsUrl = App.testMode ? "/data/apps/runs.json" : App.apiPrefix + "/jobhistory/workflow?orderBy=startTime&sortDir=DESC&limit=" + App.maxRunsForAppBrowser;
-    var runsUrl = App.testMode ? "/data/apps/runs.json" : App.apiPrefix + this.get("runUrl");
+    var runsUrl = App.get('testMode') ? "/data/apps/runs.json" : App.get('apiPrefix') + this.get("runUrl");
 
     App.HttpClient.get(runsUrl, App.runsMapper, {
       complete:function (jqXHR, textStatus) {

+ 3 - 3
ambari-web/app/controllers/main/host/details.js

@@ -356,7 +356,7 @@ App.MainHostDetailsController = Em.Controller.extend({
   upgradeComponentSuccessCallback: function (data, opt, params) {
     console.log('Send request for UPGRADE successfully');
 
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.mimicWorkStatusChange(params.component, App.HostComponentStatus.starting, App.HostComponentStatus.started);
     }
     this.showBackgroundOperationsPopup();
@@ -548,7 +548,7 @@ App.MainHostDetailsController = Em.Controller.extend({
     var self = this;
     console.log('Send request for INSTALLING NEW COMPONENT successfully');
 
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.mimicWorkStatusChange(params.component, App.HostComponentStatus.installing, App.HostComponentStatus.stopped);
     }
 
@@ -823,7 +823,7 @@ App.MainHostDetailsController = Em.Controller.extend({
    */
   installComponentSuccessCallback: function (data, opt, params) {
     console.log('Send request for REINSTALL COMPONENT successfully');
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.mimicWorkStatusChange(params.component, App.HostComponentStatus.installing, App.HostComponentStatus.stopped);
     }
     this.showBackgroundOperationsPopup();

+ 2 - 2
ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js

@@ -289,7 +289,7 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({
    * @return {String}
    */
   createDatasetXML: function () {
-    var datasetNamePrefix = App.mirroringDatasetNamePrefix;
+    var datasetNamePrefix = App.get('mirroringDatasetNamePrefix');
     var datasetName = this.get('formFields.datasetName');
     var prefixedDatasetName = datasetNamePrefix + datasetName;
     var sourceCluster = App.get('clusterName');
@@ -315,7 +315,7 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({
    * @param {String} datasetXML
    */
   sendDatasetToServer: function (datasetXML) {
-    var datasetNamePrefix = App.mirroringDatasetNamePrefix;
+    var datasetNamePrefix = App.get('mirroringDatasetNamePrefix');
     var datasetName = this.get('formFields.datasetName');
     var prefixedDatasetName = datasetNamePrefix + datasetName;
     return App.ajax.send({

+ 3 - 3
ambari-web/app/controllers/main/service/item.js

@@ -64,13 +64,13 @@ App.MainServiceItemController = Em.Controller.extend({
       var config = this.get('callBackConfig')[(JSON.parse(ajaxOptions.data)).Body.ServiceInfo.state];
       var self = this;
       console.log('Send request for ' + config.c + ' successfully');
-      if (App.testMode) {
+      if (App.get('testMode')) {
         self.set('content.workStatus', App.Service.Health[config.f]);
         self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus[config.f]);
         setTimeout(function () {
           self.set('content.workStatus', App.Service.Health[config.c2]);
           self.get('content.hostComponents').setEach('workStatus', App.HostComponentStatus[config.hs]);
-        }, App.testModeDelayForActions);
+        }, App.get('testModeDelayForActions'));
       }
       // load data (if we need to show this background operations popup) from persist
       App.router.get('applicationController').dataLoading().done(function (initValue) {
@@ -338,7 +338,7 @@ App.MainServiceItemController = Em.Controller.extend({
   setStartStopState: function () {
     var serviceName = this.get('content.serviceName');
     var backgroundOperations = App.router.get('backgroundOperationsController.services');
-    if (backgroundOperations.length > 0) {
+    if (backgroundOperations && backgroundOperations.length > 0) {
       for (var i = 0; i < backgroundOperations.length; i++) {
         if (backgroundOperations[i].isRunning &&
             (backgroundOperations[i].dependentService === "ALL_SERVICES" ||

+ 2 - 2
ambari-web/app/controllers/main/service/reassign_controller.js

@@ -83,8 +83,8 @@ App.ReassignMasterController = App.WizardController.extend({
   }.observes('content.reassign.component_name', 'content.securityEnabled'),
 
   getSecurityStatus: function () {
-    if (App.testMode) {
-      this.set('securityEnabled', !App.testEnableSecurity);
+    if (App.get('testMode')) {
+      this.set('securityEnabled', !App.get('testEnableSecurity'));
     } else {
       //get Security Status From Server
       App.ajax.send({

+ 7 - 7
ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js

@@ -81,7 +81,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
     clusterStatus = jQuery.extend(oldStatus, clusterStatus);
     this.set('content.cluster', clusterStatus);
     App.router.get(this.get('content.controllerName')).save('cluster');
-    if(!App.testMode){
+    if(!App.get('testMode')){
       App.clusterStatus.setClusterStatus({
         clusterName: this.get('content.cluster.name'),
         clusterState: clusterStatus.status,
@@ -144,7 +144,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
   stopServices: function () {
     var process = this.get('processes').findProperty('name', 'STOP_SERVICES');
     process.set('isRunning', true);
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.startPolling();
       this.saveClusterStatus({
         requestId: 1,
@@ -193,7 +193,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
   runUpgrade: function () {
     var process = this.get('processes').findProperty('name', 'UPGRADE_SERVICES');
     process.set('isRunning', true);
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.startPolling();
       this.saveClusterStatus({
         requestId: 1,
@@ -239,7 +239,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
   startPolling: function(){
     if(!this.get('isPolling')){
       this.set('isPolling', true);
-      if (App.testMode) {
+      if (App.get('testMode')) {
         this.simulatePolling();
       } else {
         //pass an interval "1" to start poll immediately first time
@@ -285,7 +285,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
   getUrl:function(){
     var requestId = this.get('content.cluster.requestId');
     var clusterName = this.get('content.cluster.name');
-    if(App.testMode){
+    if(App.get('testMode')){
       return this.get('mockUrl');
     }
     return App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/*';
@@ -326,7 +326,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
   doPollSuccessCallback: function (data) {
     var result = this.parseTasks(data);
     if(result){
-      if (App.testMode) {
+      if (App.get('testMode')) {
         this.simulatePolling();
       }
       else {
@@ -508,7 +508,7 @@ App.StackUpgradeStep3Controller = Em.Controller.extend({
     var clusterStatus = this.get('content.cluster.status');
     var upgrade = this.get('processes').findProperty('name', 'UPGRADE_SERVICES');
     var stop = this.get('processes').findProperty('name', 'STOP_SERVICES');
-    if(App.testMode){
+    if(App.get('testMode')){
       if(this.get('processes').everyProperty('isRunning', false)){
         stop.set('isRunning', true);
       }

+ 1 - 1
ambari-web/app/controllers/wizard/step2_controller.js

@@ -62,7 +62,7 @@ App.WizardStep2Controller = Em.Controller.extend({
 
   /**
    * "Shortcut" to <code>content.installOptions.hostNames</code>
-   * @type {string[]}
+   * @type {string}
    */
   hostNames: function () {
     return this.get('content.installOptions.hostNames').toLowerCase();

+ 7 - 7
ambari-web/app/controllers/wizard/step3_controller.js

@@ -148,7 +148,7 @@ App.WizardStep3Controller = Em.Controller.extend({
    * @type {bool}
    */
   isWarningsBoxVisible: function () {
-    return (App.testMode) ? true : !this.get('isRegistrationInProgress');
+    return (App.get('testMode')) ? true : !this.get('isRegistrationInProgress');
   }.property('isRegistrationInProgress'),
 
   /**
@@ -225,7 +225,7 @@ App.WizardStep3Controller = Em.Controller.extend({
     var hostsInfo = this.get('content.hosts');
     var hosts = [];
     var bootStatus = (this.get('content.installOptions.manualInstall')) ? 'DONE' : 'PENDING';
-    if (App.testMode) {
+    if (App.get('testMode')) {
       bootStatus = 'REGISTERED';
     }
 
@@ -574,7 +574,7 @@ App.WizardStep3Controller = Em.Controller.extend({
     var stopPolling = true;
     hosts.forEach(function (_host, index) {
       // Change name of first host for test mode.
-      if (App.testMode) {
+      if (App.get('testMode')) {
         if (index == 0) {
           _host.set('name', 'localhost.localdomain');
         }
@@ -840,7 +840,7 @@ App.WizardStep3Controller = Em.Controller.extend({
     var resource_filters = {
       "hosts": hosts
     };
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.getHostNameResolutionSuccess();
     } else {
       return App.ajax.send({
@@ -857,7 +857,7 @@ App.WizardStep3Controller = Em.Controller.extend({
   },
 
   getHostNameResolutionSuccess: function(response) {
-    if (!App.testMode) {
+    if (!App.get('testMode')) {
       this.set("requestId", response.Requests.id);
     }
     this.getHostCheckTasks();
@@ -982,7 +982,7 @@ App.WizardStep3Controller = Em.Controller.extend({
             hostsDiskNames.push(host_name);
           }
           // "Transparent Huge Pages" check
-          context = self.checkTHP(host_name, host.Hosts.last_agent_env.transparentHugePage);
+          context = self.checkTHP(host_name, Em.get(host, 'Hosts.last_agent_env.transparentHugePage'));
           if (context) {
             thpContext.push(context);
             thpHostsNames.push(host_name);
@@ -1305,7 +1305,7 @@ App.WizardStep3Controller = Em.Controller.extend({
    * @method parseWarnings
    */
   parseWarnings: function (data) {
-    data = App.testMode ? data : this.filterBootHosts(data);
+    data = App.get('testMode') ? data : this.filterBootHosts(data);
     var warnings = [];
     var warning;
     var hosts = [];

+ 1 - 1
ambari-web/app/controllers/wizard/step8_controller.js

@@ -594,7 +594,7 @@ App.WizardStep8Controller = Em.Controller.extend({
   loadRepoInfoSuccessCallback: function (data) {
     var allRepos = [];
     data.items.forEach(function (os) {
-      if (!App.supports.ubuntu && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation
+      if (!App.get('supports.ubuntu') && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation
       os.repositories.forEach(function (repository) {
         allRepos.push(Em.Object.create({
           base_url: repository.Repositories.base_url,

+ 7 - 7
ambari-web/app/controllers/wizard/step9_controller.js

@@ -117,7 +117,7 @@ App.WizardStep9Controller = Em.Controller.extend({
    * @method togglePreviousSteps
    */
   togglePreviousSteps: function () {
-    if (App.testMode) {
+    if (App.get('testMode')) {
       return;
     }
     var installerController = App.router.get('installerController');
@@ -258,7 +258,7 @@ App.WizardStep9Controller = Em.Controller.extend({
    * @method navigateStep
    */
   navigateStep: function () {
-    if (App.testMode) {
+    if (App.get('testMode')) {
       // this is for repeatedly testing out installs in test mode
       this.set('content.cluster.status', 'PENDING');
       this.set('content.cluster.isCompleted', false);
@@ -949,7 +949,7 @@ App.WizardStep9Controller = Em.Controller.extend({
    */
   loadLogData: function (startPolling) {
     var requestsId = this.get('wizardController').getDBProperty('cluster').oldRequestsId;
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.set('POLL_INTERVAL', 1);
     }
     this.getLogsByRequest(!!startPolling, requestsId[requestsId.length-1]);
@@ -1064,7 +1064,7 @@ App.WizardStep9Controller = Em.Controller.extend({
    */
   doPolling: function () {
     var requestId = this.get('content.cluster.requestId');
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.incrementProperty('numPolls');
     }
     this.getLogsByRequest(true, requestId);
@@ -1161,7 +1161,7 @@ App.WizardStep9Controller = Em.Controller.extend({
    * @method saveClusterStatus
    */
   saveClusterStatus: function (clusterStatus) {
-    if (!App.testMode) {
+    if (!App.get('testMode')) {
       App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
     }
     else {
@@ -1175,9 +1175,9 @@ App.WizardStep9Controller = Em.Controller.extend({
    * @method saveInstalledHosts
    */
   saveInstalledHosts: function (context) {
-    if (!App.testMode) {
+    if (!App.get('testMode')) {
       App.router.get(this.get('content.controllerName')).saveInstalledHosts(context);
     }
   }
 
-});
+});

+ 1 - 1
ambari-web/app/models/host.js

@@ -186,7 +186,7 @@ App.Host = DS.Model.extend({
    * @returns {bool}
    */
   isNotHeartBeating : function() {
-    return (App.testMode) ? false : (this.get('healthStatus') === "UNKNOWN");
+    return (App.get('testMode')) ? false : (this.get('healthStatus') === "UNKNOWN");
   }.property('lastHeartBeatTime'),
 
   /**

+ 3 - 3
ambari-web/app/router.js

@@ -161,7 +161,7 @@ App.Router = Em.Router.extend({
     var hash = window.btoa(loginName + ":" + controller.get('password'));
     var usr = '';
 
-    if (App.testMode) {
+    if (App.get('testMode')) {
       if (loginName === "admin" && controller.get('password') === 'admin') {
         usr = 'admin';
       } else if (loginName === 'user' && controller.get('password') === 'user') {
@@ -254,7 +254,7 @@ App.Router = Em.Router.extend({
   },
 
   getSection: function (callback) {
-    if (App.testMode) {
+    if (App.get('testMode')) {
       if (App.alwaysGoToInstaller) {
         callback('installer');
       } else {
@@ -309,7 +309,7 @@ App.Router = Em.Router.extend({
     this.set('loginController.loginName', '');
     this.set('loginController.password', '');
     // When logOff is called by Sign Out button, context contains event object. As it is only case we should send logoff request, we are checking context below.
-    if (!App.testMode && context) {
+    if (!App.get('testMode') && context) {
       App.ajax.send({
         name: 'router.logoff',
         sender: this,

+ 2 - 2
ambari-web/app/routes/add_host_routes.js

@@ -277,7 +277,7 @@ module.exports = App.WizardRoute.extend({
         var wizardStep9Controller = router.get('wizardStep9Controller');
         wizardStep9Controller.set('wizardController', controller);
         controller.loadAllPriorSteps();
-        if (!App.testMode) {              //if test mode is ON don't disable prior steps link.
+        if (!App.get('testMode')) {              //if test mode is ON don't disable prior steps link.
           controller.setLowerStepsDisable(6);
         }
         controller.connectOutlet('wizardStep9', controller.get('content'));
@@ -328,7 +328,7 @@ module.exports = App.WizardRoute.extend({
         controller.loadAllPriorSteps();
         var wizardStep10Controller = router.get('wizardStep10Controller');
         wizardStep10Controller.set('wizardController', controller);
-        if (!App.testMode) {              //if test mode is ON don't disable prior steps link.
+        if (!App.get('testMode')) {              //if test mode is ON don't disable prior steps link.
           controller.setLowerStepsDisable(7);
         }
         controller.connectOutlet('wizardStep10', controller.get('content'));

+ 3 - 3
ambari-web/app/routes/add_security.js

@@ -103,7 +103,7 @@ module.exports = App.WizardRoute.extend({
     route: '/start',
     enter: function (router) {
       router.get('addSecurityController').setCurrentStep('1');
-      if(!App.testMode){
+      if(!App.get('testMode')){
         App.clusterStatus.setClusterStatus({
           clusterName: this.get('clusterName'),
           clusterState: 'ADD_SECURITY_STEP_1',
@@ -139,7 +139,7 @@ module.exports = App.WizardRoute.extend({
 
     enter: function (router) {
       router.get('addSecurityController').setCurrentStep('2');
-      if(!App.testMode){
+      if(!App.get('testMode')){
         App.clusterStatus.setClusterStatus({
           clusterName: this.get('clusterName'),
           clusterState: 'ADD_SECURITY_STEP_2',
@@ -173,7 +173,7 @@ module.exports = App.WizardRoute.extend({
 
     enter: function (router) {
       router.get('addSecurityController').setCurrentStep('3');
-      if(!App.testMode){
+      if(!App.get('testMode')){
         App.clusterStatus.setClusterStatus({
           clusterName: this.get('clusterName'),
           clusterState: 'ADD_SECURITY_STEP_3',

+ 1 - 1
ambari-web/app/routes/add_service_routes.js

@@ -266,7 +266,7 @@ module.exports = App.WizardRoute.extend({
         controller.loadAllPriorSteps();
         var wizardStep9Controller = router.get('wizardStep9Controller');
         wizardStep9Controller.set('wizardController', controller);
-        if (!App.testMode) {              //if test mode is ON don't disable prior steps link.
+        if (!App.get('testMode')) {              //if test mode is ON don't disable prior steps link.
           controller.setLowerStepsDisable(6);
         }
         controller.connectOutlet('wizardStep9', controller.get('content'));

+ 3 - 3
ambari-web/app/routes/installer.js

@@ -145,7 +145,7 @@ module.exports = Em.Route.extend({
     next: function (router) {
       var wizardStep1Controller = router.get('wizardStep1Controller');
       var installerController = router.get('installerController');
-      if (App.testMode) {
+      if (App.get('testMode')) {
         installerController.set('validationCnt', 0);
         installerController.set('invalidCnt', 0);
       } else {
@@ -369,7 +369,7 @@ module.exports = Em.Route.extend({
       var controller = router.get('installerController');
       controller.setCurrentStep('9');
       controller.loadAllPriorSteps().done(function () {
-        if (!App.testMode) {
+        if (!App.get('testMode')) {
           controller.setLowerStepsDisable(9);
         }
         var wizardStep9Controller = router.get('wizardStep9Controller');
@@ -416,7 +416,7 @@ module.exports = Em.Route.extend({
       var controller = router.get('installerController');
       controller.setCurrentStep('10');
       controller.loadAllPriorSteps().done(function () {
-        if (!App.testMode) {
+        if (!App.get('testMode')) {
           controller.setLowerStepsDisable(10);
         }
         controller.connectOutlet('wizardStep10', controller.get('content'));

+ 1 - 1
ambari-web/app/utils/host_progress_popup.js

@@ -496,7 +496,7 @@ App.HostPopup = Em.Object.create({
       updateNotShowBgChecked: function () {
         var curVal = !this.get('isNotShowBgChecked');
         var key = App.router.get('applicationController').persistKey();
-        if (!App.testMode) {
+        if (!App.get('testMode')) {
           App.router.get('applicationController').postUserPref(key, curVal);
         }
       }.observes('isNotShowBgChecked'),

+ 1 - 1
ambari-web/app/utils/jobs.js

@@ -58,7 +58,7 @@ module.exports = {
     var ahsWebPort = yarnService.get('ahsWebPort');
     var hiveJobId = hiveJob.get('id');
     // First refresh query
-    var hiveQueriesUrl = App.testMode ? "/data/jobs/hive-query-2.json" : "/proxy?url=http://" + historyServerHostName
+    var hiveQueriesUrl = App.get('testMode') ? "/data/jobs/hive-query-2.json" : "/proxy?url=http://" + historyServerHostName
         + ":" + ahsWebPort + "/ws/v1/timeline/HIVE_QUERY_ID/" + hiveJob.get('id') + "?fields=events,otherinfo";
     App.HttpClient.get(hiveQueriesUrl, App.hiveJobMapper, {
       complete : function(jqXHR, textStatus) {

+ 1 - 1
ambari-web/app/utils/polling.js

@@ -60,7 +60,7 @@ App.Poll = Em.Object.extend({
   },
 
   setRequestId: function () {
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.set('requestId', '1');
       this.doPolling();
       return;

+ 1 - 1
ambari-web/app/views/common/table_view.js

@@ -346,7 +346,7 @@ App.TableView = Em.View.extend(App.UserPref, {
     var self = this;
     Em.run.next(function() {
       App.db.setDisplayLength(self.get('controller.name'), self.get('displayLength'));
-      if (!App.testMode) {
+      if (!App.get('testMode')) {
         if (App.get('isAdmin')) {
           self.postUserPref(self.displayLengthKey(), self.get('displayLength'));
         }

+ 1 - 1
ambari-web/app/views/main/apps/item/bar_view.js

@@ -49,7 +49,7 @@ App.MainAppsItemBarView = Em.View.extend({
   finish:false,
 
   updateTasksView:function () {
-    var url = App.testMode ? '/data/apps/jobs/taskview.json' : App.apiPrefix + "/jobhistory/tasklocality?workflowId=" + this.get('controller.content.id');
+    var url = App.get('testMode') ? '/data/apps/jobs/taskview.json' : App.get('apiPrefix') + "/jobhistory/tasklocality?workflowId=" + this.get('controller.content.id');
     var mapper = App.jobTasksMapper;
     mapper.set('model', this);
     var self = this;

+ 2 - 2
ambari-web/app/views/main/apps/item/dag_view.js

@@ -106,7 +106,7 @@ App.MainAppsItemDagView = Em.View.extend({
   allreduce:false,
 
   updateTimeline:function () {
-    var url = App.testMode ? '/data/apps/jobs/timeline.json' : App.apiPrefix + "/jobhistory/task?workflowId=" + this.get('controller.content.id') + "&width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime'));
+    var url = App.get('testMode') ? '/data/apps/jobs/timeline.json' : App.get('apiPrefix') + "/jobhistory/task?workflowId=" + this.get('controller.content.id') + "&width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime'));
     var mapper = App.jobTimeLineMapper;
     mapper.set('model', this);
     var self = this;
@@ -115,7 +115,7 @@ App.MainAppsItemDagView = Em.View.extend({
         self.set('loadJobTimeline', true);
       }
     });
-    url = App.testMode ? '/data/apps/jobs/timeline.json' : App.apiPrefix + "/jobhistory/task?width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime'));
+    url = App.get('testMode') ? '/data/apps/jobs/timeline.json' : App.get('apiPrefix') + "/jobhistory/task?width=" + this.$().width() + "&startTime=" + this.get('controller.content.startTime') + "&endTime=" + (this.get('controller.content.startTime')+this.get('controller.content.elapsedTime'));
     var mapper = App.taskTimeLineMapper;
     mapper.set('model', this);
     var self = this;

+ 1 - 1
ambari-web/app/views/main/dashboard/widget.js

@@ -154,7 +154,7 @@ App.DashboardWidgetView = Em.View.extend({
           self.set('thresh1', parseFloat(configObj.get('thresh1')) );
           self.set('thresh2', parseFloat(configObj.get('thresh2')) );
 
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             // save to persist
             var parent = self.get('parentView');
             parent.getUserPref(parent.get('persistKey')).complete(function () {

+ 4 - 4
ambari-web/app/views/main/dashboard/widgets.js

@@ -54,7 +54,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
       //placeholder: "sortable-placeholder",
       cursor: "move",
       update: function (event, ui) {
-        if (!App.testMode) {
+        if (!App.get('testMode')) {
           // update persist then translate to real
           var widgetsArray = $('div[viewid]'); // get all in DOM
           self.getUserPref(self.get('persistKey')).complete(function () {
@@ -216,7 +216,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
         var hiddenWidgets = this.get('hiddenWidgets');
         var checkedWidgets = hiddenWidgets.filterProperty('checked', true);
 
-        if (App.testMode) {
+        if (App.get('testMode')) {
           var visibleWidgets = this.get('visibleWidgets');
           checkedWidgets.forEach(function(item){
             var newObj = parent.widgetsMapper(item.id);
@@ -291,7 +291,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
    */
   setOnLoadVisibleWidgets: function () {
     var self = this;
-    if (App.testMode) {
+    if (App.get('testMode')) {
       this.translateToReal(this.get('initPrefObject'));
     } else {
       // called when first load/refresh/jump back page
@@ -526,7 +526,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
   resetAllWidgets: function() {
     var self = this;
     App.showConfirmationPopup(function() {
-      if(!App.testMode) {
+      if(!App.get('testMode')) {
         self.postUserPref(self.get('persistKey'), self.get('initPrefObject'));
         self.setDBProperty(self.get('persistKey'), self.get('initPrefObject'));
       }

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/datanode_live.js

@@ -127,7 +127,7 @@ App.DataNodeUpView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));
             var oldValue = big_parent.get('currentPrefObject');

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/flume_agent_live.js

@@ -132,7 +132,7 @@ App.FlumeAgentUpView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));
             var oldValue = big_parent.get('currentPrefObject');

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/hbase_average_load.js

@@ -121,7 +121,7 @@ App.HBaseAverageLoadView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             //save to persist
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/hbase_regions_in_transition.js

@@ -117,7 +117,7 @@ App.HBaseRegionsInTransitionView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             //save to persist
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/jobtracker_rpc.js

@@ -122,7 +122,7 @@ App.JobTrackerRpcView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             // save to persist
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/namenode_rpc.js

@@ -124,7 +124,7 @@ App.NameNodeRpcView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             //save to persist
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/node_managers_live.js

@@ -130,7 +130,7 @@ App.NodeManagersLiveView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             //save to persit
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/supervisor_live.js

@@ -131,7 +131,7 @@ App.SuperVisorUpView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));
             var oldValue = big_parent.get('currentPrefObject');

+ 1 - 1
ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js

@@ -117,7 +117,7 @@ App.TaskTrackerUpView = App.TextDashboardWidgetView.extend({
         if (!configObj.isThresh1Error && !configObj.isThresh2Error) {
           parent.set('thresh1', parseFloat(configObj.get('thresh1')) );
           parent.set('thresh2', parseFloat(configObj.get('thresh2')) );
-          if (!App.testMode) {
+          if (!App.get('testMode')) {
             //save to persit
             var big_parent = parent.get('parentView');
             big_parent.getUserPref(big_parent.get('persistKey'));

+ 2 - 1
ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js

@@ -134,7 +134,8 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
   categoryWarnings: function () {
     var warningsByHost = this.get('warningsByHost');
     if (Em.isNone(warningsByHost)) return [];
-    return warningsByHost.findProperty('name', this.get('category')).warnings;
+    var category = warningsByHost.findProperty('name', this.get('category'));
+    return Em.isNone(category) ? []: category.warnings;
   }.property('warningsByHost', 'category'),
 
   /**

+ 1 - 1
ambari-web/app/views/wizard/step8_view.js

@@ -47,7 +47,7 @@ App.WizardStep8View = Em.View.extend({
    * @method showLoadingIndicator
    */
   showLoadingIndicator: function () {
-    if (!this.get('controller.isSubmitDisabled') || App.testMode) {
+    if (!this.get('controller.isSubmitDisabled') || App.get('testMode')) {
       if (this.get('modalPopup')) {
         this.get('modalPopup').hide();
         this.set('modalPopup', null);