Updated Branches: refs/heads/branch-1.2.5 b7316c60b -> 7cf113337
AMBARI-2820: In secured cluster enabling wizard, hostname part in the principal should be displayed in lower case format. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/7cf11333 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/7cf11333 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/7cf11333 Branch: refs/heads/branch-1.2.5 Commit: 7cf113337e6608d5d11e2d4538413dd6733c8645 Parents: b7316c6 Author: Jaimin Jetly <[email protected]> Authored: Tue Aug 6 11:07:16 2013 -0700 Committer: Jaimin Jetly <[email protected]> Committed: Tue Aug 6 11:21:19 2013 -0700 ---------------------------------------------------------------------- .../controllers/main/admin/security/add/step2.js | 17 +++++++++-------- .../controllers/main/admin/security/add/step3.js | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7cf11333/ambari-web/app/controllers/main/admin/security/add/step2.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step2.js b/ambari-web/app/controllers/main/admin/security/add/step2.js index fefa2e7..60a9233 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step2.js +++ b/ambari-web/app/controllers/main/admin/security/add/step2.js @@ -196,8 +196,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) { @@ -207,11 +207,12 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({ } } if(webHcatService) { - var webHcatHost = webHcatService.configs.findProperty('name', 'webhcatserver_host'); - 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; + var webHcatHost = webHcatService.configs.findProperty('name', 'webhcatserver_host'); + 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.toLowerCase(); + } } @@ -220,7 +221,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){ http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7cf11333/ambari-web/app/controllers/main/admin/security/add/step3.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step3.js b/ambari-web/app/controllers/main/admin/security/add/step3.js index 0ce41bb..0d42a4f 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step3.js +++ b/ambari-web/app/controllers/main/admin/security/add/step3.js @@ -135,7 +135,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: hadoopHttpKeytabPath, owner: 'root', @@ -150,7 +150,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: webHCatHttpKeytabPath, owner: 'root', @@ -165,7 +165,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: oozieHttpKeytabPath, owner: 'root', @@ -180,13 +180,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; }
