Browse Source

AMBARI-15333. Host check warning for User Issues shows incorrect message (alexantonenko)

Alex Antonenko 9 years ago
parent
commit
eb6b0da8eb

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

@@ -1222,14 +1222,14 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
       var existingUsers = lastAgentEnvCheck.existingUsers;
       if (existingUsers) {
         existingUsers.forEach(function (user) {
-          warning = warningCategories.usersWarnings[user.userName];
+          warning = warningCategories.usersWarnings[user.name];
           if (warning) {
             warning.hosts.push(hostName);
             warning.hostsLong.push(hostName);
             warning.onSingleHost = false;
           } else {
-            warningCategories.usersWarnings[user.userName] = warning = {
-              name: user.userName,
+            warningCategories.usersWarnings[user.name] = warning = {
+              name: user.name,
               hosts: [hostName],
               hostsLong: [hostName],
               category: 'users',
@@ -1902,14 +1902,14 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
       //todo: to be removed after check in new API
       if (_host.Hosts.last_agent_env.existingUsers) {
         _host.Hosts.last_agent_env.existingUsers.forEach(function (user) {
-          warning = warningCategories.usersWarnings[user.userName];
+          warning = warningCategories.usersWarnings[user.name];
           if (warning) {
             warning.hosts.push(_host.Hosts.host_name);
             warning.hostsLong.push(_host.Hosts.host_name);
             warning.onSingleHost = false;
           } else {
-            warningCategories.usersWarnings[user.userName] = warning = {
-              name: user.userName,
+            warningCategories.usersWarnings[user.name] = warning = {
+              name: user.name,
               hosts: [_host.Hosts.host_name],
               hostsLong: [_host.Hosts.host_name],
               category: 'users',

+ 6 - 6
ambari-web/test/controllers/wizard/step3_test.js

@@ -1425,7 +1425,7 @@ describe('App.WizardStep3Controller', function () {
             {
               tasks: [
                 {Tasks: {host_name: 'c1',
-                         structured_out: {last_agent_env_check: {existingUsers: [{userName: 'n1'}]}}
+                         structured_out: {last_agent_env_check: {existingUsers: [{name: 'n1'}]}}
                         }
                 }
               ],
@@ -1445,11 +1445,11 @@ describe('App.WizardStep3Controller', function () {
             {
               tasks: [
                 {Tasks: {host_name: 'c1',
-                         structured_out:{last_agent_env_check: {existingUsers: [{userName: 'n1'}]}}
+                         structured_out:{last_agent_env_check: {existingUsers: [{name: 'n1'}]}}
                         }
                 },
                 {Tasks: {host_name: 'c2',
-                         structured_out:{last_agent_env_check: {existingUsers: [{userName: 'n1'}]}}
+                         structured_out:{last_agent_env_check: {existingUsers: [{name: 'n1'}]}}
                         }
                 }
               ],
@@ -1910,7 +1910,7 @@ describe('App.WizardStep3Controller', function () {
             {
               items: [
                 {Hosts: {host_name: 'c1', last_agent_env: {existingUsers: [
-                  {userName: 'n1'}
+                  {name: 'n1'}
                 ]}}}
               ],
               m: 'not empty existingUsers',
@@ -1929,10 +1929,10 @@ describe('App.WizardStep3Controller', function () {
             {
               items: [
                 {Hosts: {host_name: 'c1', last_agent_env: {existingUsers: [
-                  {userName: 'n1'}
+                  {name: 'n1'}
                 ]}}},
                 {Hosts: {host_name: 'c2', last_agent_env: {existingUsers: [
-                  {userName: 'n1'}
+                  {name: 'n1'}
                 ]}}}
               ],
               m: 'not empty existingUsers on two hosts',