ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-9722. Ability to adjust hadoop.security.auth_to_local property on Configure Identities page (onechiporenko)
Date Fri, 20 Feb 2015 13:45:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk afc6a9dc1 -> 1103f0cec


AMBARI-9722. Ability to adjust hadoop.security.auth_to_local property on Configure Identities
page (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1103f0ce
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1103f0ce
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1103f0ce

Branch: refs/heads/trunk
Commit: 1103f0cec3ab6de046c23012031c49b8a251064b
Parents: afc6a9d
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Fri Feb 20 15:13:51 2015 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Fri Feb 20 15:45:33 2015 +0200

----------------------------------------------------------------------
 .../app/controllers/main/admin/kerberos.js      |  3 +++
 .../main/admin/kerberos/step4_controller.js     |  3 +++
 .../admin/kerberos/step4_controller_test.js     | 20 +++++++++++++++++---
 .../controllers/main/admin/kerberos_test.js     | 16 ++++++++++++++++
 4 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1103f0ce/ambari-web/app/controllers/main/admin/kerberos.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos.js b/ambari-web/app/controllers/main/admin/kerberos.js
index f74db42..808c2c7 100644
--- a/ambari-web/app/controllers/main/admin/kerberos.js
+++ b/ambari-web/app/controllers/main/admin/kerberos.js
@@ -270,6 +270,9 @@ App.MainAdminKerberosController = App.KerberosWizardStep4Controller.extend({
             property.set('index', siteProperty.index);
           }
         }
+        if (siteProperty.displayType) {
+          property.set('displayType', siteProperty.displayType);
+        }
       }
     });
     configProperties.setEach('isEditable', false);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1103f0ce/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index 3043ddd..06208ee 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -180,6 +180,9 @@ App.KerberosWizardStep4Controller = App.WizardStep7Controller.extend(App.AddSecu
             property.set('index', siteProperty.index);
           }
         }
+        if (siteProperty.displayType) {
+          property.set('displayType', siteProperty.displayType);
+        }
       }
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1103f0ce/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
index c86f314..b45a3a4 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
@@ -50,7 +50,7 @@ describe('App.KerberosWizardStep4Controller', function() {
   });
 
   describe('#prepareConfigProperties', function() {
-    
+
     before(function() {
       var controller = App.KerberosWizardStep4Controller.create({
         wizardController: {
@@ -64,11 +64,18 @@ describe('App.KerberosWizardStep4Controller', function() {
       sinon.stub(App.Service, 'find').returns(Em.A([
         { serviceName: 'HDFS' }
       ]));
+      sinon.stub(App.config, 'get').withArgs('preDefinedSiteProperties').returns([
+        {
+          name: 'hadoop.security.auth_to_local',
+          displayType: 'multiLine'
+        }
+      ]);
       this.result = controller.prepareConfigProperties(properties);
     });
 
     after(function() {
       App.Service.find.restore();
+      App.config.get.restore();
     });
 
     var properties = Em.A([
@@ -77,7 +84,8 @@ describe('App.KerberosWizardStep4Controller', function() {
       Em.Object.create({ name: 'hdfs_keytab', value: '', serviceName: 'HDFS', identityType:
'user', observesValueFrom: 'spnego_keytab' }),
       Em.Object.create({ name: 'falcon_keytab', value: 'falcon_keytab_value', serviceName:
'FALCON' }),
       Em.Object.create({ name: 'mapreduce_keytab', value: 'mapreduce_keytab_value', serviceName:
'MAPREDUCE2' }),
-      Em.Object.create({ name: 'hdfs_principal', value: 'hdfs_principal_value', identityType:
'user', serviceName: 'HDFS' })
+      Em.Object.create({ name: 'hdfs_principal', value: 'hdfs_principal_value', identityType:
'user', serviceName: 'HDFS' }),
+      Em.Object.create({ name: 'hadoop.security.auth_to_local', serviceName: 'HDFS' })
     ]);
     
     var propertyValidationCases = [
@@ -98,10 +106,16 @@ describe('App.KerberosWizardStep4Controller', function() {
       {
         property: 'hdfs_keytab',
         e: [
-          {key: 'category', value: 'Ambari Principals'},
+          { key: 'category', value: 'Ambari Principals' },
           { key: 'value', value: 'spnego_keytab_value' },
           { key: 'observesValueFrom', value: 'spnego_keytab' }
         ]
+      },
+      {
+        property: 'hadoop.security.auth_to_local',
+        e: [
+          { key: 'displayType', value: 'multiLine' }
+        ]
       }
     ];
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/1103f0ce/ambari-web/test/controllers/main/admin/kerberos_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos_test.js b/ambari-web/test/controllers/main/admin/kerberos_test.js
index ec80ca2..57b9c94 100644
--- a/ambari-web/test/controllers/main/admin/kerberos_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos_test.js
@@ -54,6 +54,22 @@ describe('App.MainAdminKerberosController', function() {
         expect(prop.get('isEditable')).to.be.false;
       });
     });
+
+    it('should take displayType from predefinedSiteProperties', function () {
+      sinon.stub(App.config, 'get').withArgs('preDefinedSiteProperties').returns([
+        {
+          name: 'hadoop.security.auth_to_local',
+          displayType: 'multiLine'
+        }
+      ]);
+      expect(controller.prepareConfigProperties([
+        Em.Object.create({
+          name: 'hadoop.security.auth_to_local',
+          serviceName: 'HDFS'
+        })
+      ])[0].get('displayType')).to.equal('multiLine');
+      App.config.get.restore();
+    });
   });
 
   describe("#runSecurityCheckSuccess()", function () {


Mime
View raw message