Browse Source

AMBARI-2820: In secured cluster enabling wizard, hostname part in the principal should be displayed in lower case format. (jaimin)

Jaimin Jetly 12 years ago
parent
commit
8dcabe83b2

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

@@ -201,8 +201,8 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({
       var oozieSpnegoPrincipal = oozieService.configs.findProperty('name', 'oozie_http_principal_name');
       if (oozieServerHost && oozieServerPrincipal && oozieSpnegoPrincipal) {
         oozieServerHost.defaultValue = App.Service.find('OOZIE').get('hostComponents').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName');
-        oozieServerPrincipal.defaultValue = 'oozie/' + oozieServerHost.defaultValue;
-        oozieSpnegoPrincipal.defaultValue = 'HTTP/' + oozieServerHost.defaultValue;
+        oozieServerPrincipal.defaultValue = 'oozie/' + oozieServerHost.defaultValue.toLowerCase();
+        oozieSpnegoPrincipal.defaultValue = 'HTTP/' + oozieServerHost.defaultValue.toLowerCase();
       }
     }
     if (hiveService) {
@@ -216,7 +216,7 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({
       var webHcatSpnegoPrincipal = webHcatService.configs.findProperty('name', 'webHCat_http_principal_name');
       if (webHcatHost && webHcatSpnegoPrincipal) {
         webHcatHost.defaultValue = App.Service.find('WEBHCAT').get('hostComponents').findProperty('componentName', 'WEBHCAT_SERVER').get('host.hostName');
-        webHcatSpnegoPrincipal.defaultValue = 'HTTP/' + webHcatHost.defaultValue;
+        webHcatSpnegoPrincipal.defaultValue = 'HTTP/' + webHcatHost.defaultValue.toLowerCase();
       }
     }
 
@@ -225,7 +225,7 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({
       var nagiosServerPrincipal = nagiosService.configs.findProperty('name', 'nagios_principal_name');
       if (nagiosServerHost && nagiosServerPrincipal) {
         nagiosServerHost.defaultValue = App.Service.find('NAGIOS').get('hostComponents').findProperty('componentName', 'NAGIOS_SERVER').get('host.hostName');
-        nagiosServerPrincipal.defaultValue = 'nagios/' + nagiosServerHost.defaultValue;
+        nagiosServerPrincipal.defaultValue = 'nagios/' + nagiosServerHost.defaultValue.toLowerCase();
       }
     }
     if (hdfsService) {

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

@@ -130,7 +130,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         result.push({
           host: host.get('hostName'),
           component: Em.I18n.t('admin.addSecurity.hdfs.user.httpUser'),
-          principal: hadoopHttpPrincipal.value.replace('_HOST', host.get('hostName')) + hadoopHttpPrincipal.unit,
+          principal: hadoopHttpPrincipal.value.replace('_HOST', host.get('hostName').toLowerCase()) + hadoopHttpPrincipal.unit,
           keytabFile: stringUtils.getFileFromPath(hadoopHttpKeytabPath),
           keytab: stringUtils.getPath(hadoopHttpKeytabPath),
           owner: 'root',
@@ -145,7 +145,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         result.push({
           host: host.get('hostName'),
           component: Em.I18n.t('admin.addSecurity.webhcat.user.httpUser'),
-          principal: webHCatHttpPrincipal.value.replace('_HOST', host.get('hostName')) + webHCatHttpPrincipal.unit,
+          principal: webHCatHttpPrincipal.value.replace('_HOST', host.get('hostName').toLowerCase()) + webHCatHttpPrincipal.unit,
           keytabFile: stringUtils.getFileFromPath(webHCatHttpKeytabPath),
           keytab: stringUtils.getPath(webHCatHttpKeytabPath),
           owner: 'root',
@@ -160,7 +160,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         result.push({
           host: host.get('hostName'),
           component: Em.I18n.t('admin.addSecurity.oozie.user.httpUser'),
-          principal: oozieHttpPrincipal.value.replace('_HOST', host.get('hostName')) + oozieHttpPrincipal.unit,
+          principal: oozieHttpPrincipal.value.replace('_HOST', host.get('hostName').toLowerCase()) + oozieHttpPrincipal.unit,
           keytabFile: stringUtils.getFileFromPath(oozieHttpKeytabPath),
           keytab: stringUtils.getPath(oozieHttpKeytabPath),
           owner: 'root',
@@ -175,13 +175,13 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
           serviceConfigs.forEach(function (config) {
             if (config.component && config.component === hostComponent.get('componentName')) {
               if (config.name.endsWith('_principal_name')) {
-                principal = config.value.replace('_HOST', host.get('hostName')) + config.unit;
+                principal = config.value.replace('_HOST', host.get('hostName').toLowerCase()) + config.unit;
               } else if (config.name.endsWith('_keytab') || config.name.endsWith('_keytab_path')) {
                 keytab = config.value;
               }
             } else if (config.components && config.components.contains(hostComponent.get('componentName'))) {
               if (config.name.endsWith('_principal_name')) {
-                principal = config.value.replace('_HOST', host.get('hostName')) + config.unit;
+                principal = config.value.replace('_HOST', host.get('hostName').toLowerCase()) + config.unit;
               } else if (config.name.endsWith('_keytab') || config.name.endsWith('_keytab_path')) {
                 keytab = config.value;
               }