incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-2637: Security CSV cleanup. (jaimin)
Date Mon, 15 Jul 2013 22:54:04 GMT
Updated Branches:
  refs/heads/branch-1.2.5 09b529445 -> 7dcfefb53


AMBARI-2637: Security CSV cleanup. (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/7dcfefb5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/7dcfefb5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/7dcfefb5

Branch: refs/heads/branch-1.2.5
Commit: 7dcfefb53723ba2813edb9ea23c077d85b324a0f
Parents: 09b5294
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Mon Jul 15 15:43:32 2013 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Mon Jul 15 15:53:07 2013 -0700

----------------------------------------------------------------------
 .../main/admin/security/add/step3.js            | 26 +++++++++++++++-----
 ambari-web/app/utils/string_utils.js            |  9 +++++++
 2 files changed, 29 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7dcfefb5/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 531a722..0ce41bb 100644
--- a/ambari-web/app/controllers/main/admin/security/add/step3.js
+++ b/ambari-web/app/controllers/main/admin/security/add/step3.js
@@ -102,6 +102,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         host: host.get('hostName'),
         component: Em.I18n.t('admin.addSecurity.user.smokeUser'),
         principal: smokeUser,
+        keytabFile: stringUtils.getFileFromPath(smokeUserKeytabPath),
         keytab: smokeUserKeytabPath,
         owner: smokeUserId,
         group: hadoopGroupId,
@@ -111,6 +112,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         host: host.get('hostName'),
         component: Em.I18n.t('admin.addSecurity.user.hdfsUser'),
         principal: hdfsUser,
+        keytabFile: stringUtils.getFileFromPath(hdfsUserKeytabPath),
         keytab: hdfsUserKeytabPath,
         owner: hdfsUserId,
         group: hadoopGroupId,
@@ -121,6 +123,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
           host: host.get('hostName'),
           component: Em.I18n.t('admin.addSecurity.user.hbaseUser'),
           principal: hbaseUser,
+          keytabFile: stringUtils.getFileFromPath(hbaseUserKeytabPath),
           keytab: hbaseUserKeytabPath,
           owner: hbaseUserId,
           group: hadoopGroupId,
@@ -133,6 +136,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
           host: host.get('hostName'),
           component: Em.I18n.t('admin.addSecurity.hdfs.user.httpUser'),
           principal: hadoopHttpPrincipal.value.replace('_HOST', host.get('hostName')) + hadoopHttpPrincipal.unit,
+          keytabFile: stringUtils.getFileFromPath(hadoopHttpKeytabPath),
           keytab: hadoopHttpKeytabPath,
           owner: 'root',
           group: hadoopGroupId,
@@ -147,6 +151,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
           host: host.get('hostName'),
           component: Em.I18n.t('admin.addSecurity.webhcat.user.httpUser'),
           principal: webHCatHttpPrincipal.value.replace('_HOST', host.get('hostName')) +
webHCatHttpPrincipal.unit,
+          keytabFile: stringUtils.getFileFromPath(webHCatHttpKeytabPath),
           keytab: webHCatHttpKeytabPath,
           owner: 'root',
           group: hadoopGroupId,
@@ -161,6 +166,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
           host: host.get('hostName'),
           component: Em.I18n.t('admin.addSecurity.oozie.user.httpUser'),
           principal: oozieHttpPrincipal.value.replace('_HOST', host.get('hostName')) + oozieHttpPrincipal.unit,
+          keytabFile: stringUtils.getFileFromPath(oozieHttpKeytabPath),
           keytab: oozieHttpKeytabPath,
           owner: 'root',
           group: hadoopGroupId,
@@ -186,8 +192,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
               }
             }
           });
-
-
+          var displayName = this.changeDisplayName(hostComponent.get('displayName'));
           var key = host.get('hostName') + "--" + principal;
           if (!addedPrincipalsHost[key]) {
             var owner = componentToOwnerMap[hostComponent.get('componentName')];
@@ -196,8 +201,9 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
             }
             result.push({
               host: host.get('hostName'),
-              component: hostComponent.get('displayName'),
+              component: displayName,
               principal: principal,
+              keytabFile: stringUtils.getFileFromPath(keytab),
               keytab: keytab,
               owner: owner,
               group: hadoopGroupId,
@@ -206,8 +212,16 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
             addedPrincipalsHost[key] = true;
           }
         }
-      });
-    });
+      },this);
+    },this);
     this.set('hostComponents', result);
-  }
+  },
+
+  changeDisplayName: function (name) {
+    if (name === 'HiveServer2') {
+      return 'Hive Metastore and HiveServer2';
+    } else {
+      return name;
+    }
+  },
 });

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/7dcfefb5/ambari-web/app/utils/string_utils.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/string_utils.js b/ambari-web/app/utils/string_utils.js
index 5142601..ef6ae0e 100644
--- a/ambari-web/app/utils/string_utils.js
+++ b/ambari-web/app/utils/string_utils.js
@@ -123,5 +123,14 @@ module.exports = {
       content += row.join(',') + '\n';
     });
     return content;
+  },
+
+  /**
+   * Extracts filename from linux/unix path
+   * @param String: path
+   * @return {Sring}: filename
+   */
+  getFileFromPath: function(path) {
+    return path.replace(/^.*[\/]/, '');
   }
 }


Mime
View raw message