ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: Revert "AMBARI-12593. Enable Kerberos: Config values should be trimmed (alexantonenko)"
Date Thu, 30 Jul 2015 23:22:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b478d70c0 -> 6b3431c20


Revert "AMBARI-12593. Enable Kerberos: Config values should be trimmed (alexantonenko)"

This reverts commit 178db9fc96d76231ef6449132fc8b1bda3c01999.


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

Branch: refs/heads/trunk
Commit: 6b3431c2021852b43e09defdd419f0e8ad97dd6c
Parents: b478d70
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Thu Jul 30 16:20:49 2015 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Thu Jul 30 16:20:49 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/assets/test/tests.js             |  1 -
 .../main/admin/kerberos/step2_controller.js     |  8 +-
 ambari-web/app/data/HDP2/site_properties.js     |  3 -
 .../configs/objects/service_config_property.js  |  4 +-
 ambari-web/app/utils/config.js                  | 11 +--
 .../admin/kerberos/step2_controller_test.js     | 83 --------------------
 6 files changed, 8 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3431c2/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 5e5f472..45f6df9 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -51,7 +51,6 @@ var files = ['test/init_model_test',
   'test/controllers/main/alerts/manage_alert_notifications_controller_test',
   'test/controllers/main/admin/kerberos_test',
   'test/controllers/main/admin/kerberos/kerberos_wizard_controler_test',
-  'test/controllers/main/admin/kerberos/step2_controller_test',
   'test/controllers/main/admin/kerberos/step3_controller_test',
   'test/controllers/main/admin/kerberos/step4_controller_test',
   'test/controllers/main/admin/kerberos/step6_controller_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3431c2/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
index 30098c9..8972949 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -211,16 +211,10 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend({
     var properties = {};
     var content = this.get('stepConfigs')[0].get('configs');
     var configs = content.filterProperty('filename', site + '.xml');
-    // properties that should be formated as hosts
-      var hostProperties = ['kdc_host', 'realm'];
     configs.forEach(function (_configProperty) {
       // do not pass any globals whose name ends with _host or _hosts
       if (_configProperty.isRequiredByAgent !== false) {
-        if (hostProperties.contains(_configProperty.name)) {
-          properties[_configProperty.name] = App.config.trimProperty({displayType: 'host',
value: _configProperty.value});
-        } else {
-          properties[_configProperty.name] = App.config.trimProperty(_configProperty);
-        }
+        properties[_configProperty.name] = _configProperty.value;
       }
     }, this);
     this.tweakKdcTypeValue(properties);

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3431c2/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 16182b1..44833b2 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -2237,7 +2237,6 @@ var hdp2properties = [
     "id": "puppet var",
     "name": "realm",
     "displayName": "Realm name",
-    "displayType": "host",
     "isOverridable": false,
     "isVisible": true,
     "isRequiredByAgent": true,
@@ -2251,7 +2250,6 @@ var hdp2properties = [
     "id": "puppet var",
     "name": "ldap_url",
     "displayName": "LDAP url",
-    "displayType": "host",
     "isOverridable": false,
     "isVisible": false,
     "serviceName": "KERBEROS",
@@ -2455,7 +2453,6 @@ var hdp2properties = [
     "id": "puppet var",
     "name": "admin_server_host",
     "displayName": "Kadmin host",
-    "displayType": "host",
     "isOverridable": false,
     "isVisible": true,
     "isRequiredByAgent": true,

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3431c2/ambari-web/app/models/configs/objects/service_config_property.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js b/ambari-web/app/models/configs/objects/service_config_property.js
index 239f520..b259f56 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -428,9 +428,7 @@ App.ServiceConfigProperty = Em.Object.extend({
             isError = true;
           }
           break;
-        case 'supportTextConnection':
         case 'host':
-          var connectionProperties = ['kdc_host'];
           var hiveOozieHostNames = ['hive_hostname','hive_existing_mysql_host','hive_existing_oracle_host','hive_ambari_host',
             'oozie_hostname','oozie_existing_mysql_host','oozie_existing_oracle_host','oozie_ambari_host'];
           if(hiveOozieHostNames.contains(this.get('name'))) {
@@ -439,7 +437,7 @@ App.ServiceConfigProperty = Em.Object.extend({
               isError = true;
             }
           } else {
-            if ((validator.isNotTrimmed(value) && connectionProperties.contains(this.get('name'))
|| validator.isNotTrimmed(value))) {
+            if (validator.isNotTrimmed(value)) {
               this.set('errorMessage', Em.I18n.t('host.trimspacesValidation'));
               isError = true;
             }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3431c2/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 1cdd8a6..fd6e5c8 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1194,13 +1194,14 @@ App.config = Em.Object.create({
    * for directory or directories displayType format string for further using.
    * for password and values with spaces only do nothing.
    * @param {Object} property
+   * @param {Boolean} isEmberObject
    * @returns {*}
    */
-  trimProperty: function (property) {
-    var displayType = Em.get(property, 'displayType'),
-     value = Em.get(property, 'value'),
-     name = Em.get(property, 'name'),
-     rez;
+  trimProperty: function (property, isEmberObject) {
+    var displayType = (isEmberObject) ? property.get('displayType') : property.displayType;
+    var value = (isEmberObject) ? property.get('value') : property.value;
+    var name = (isEmberObject) ? property.get('name') : property.name;
+    var rez;
     switch (displayType) {
       case 'directories':
       case 'directory':

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b3431c2/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
deleted file mode 100644
index d8fa472..0000000
--- a/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-describe('App.KerberosWizardStep2Controller', function() {
-
-  describe('#createKerberosSiteObj', function() {
-    var controller;
-
-    beforeEach(function() {
-      sinon.stub(App, 'get').withArgs('stackVersion').returns('HDP-2.3');
-      controller = App.KerberosWizardStep2Controller.create({});
-      sinon.stub(controller, 'tweakKdcTypeValue', Em.K);
-      sinon.stub(controller, 'tweakManualKdcProperties', Em.K);
-    });
-
-    after(function() {
-      App.get.restore();
-      controller.tweakKdcTypeValue.restore();
-      controller.tweakManualKdcProperties.restore();
-    });
-
-    var _createProperty = function(name, value) {
-      var preDefProp = App.config.get('preDefinedSiteProperties').findProperty('name', name);
-      if (preDefProp) {
-        return App.ServiceConfigProperty.create(
-          $.extend(true, {}, preDefProp, {
-            value: value, filename: 'some-site.xml',
-            isRequiredByAgent: preDefProp.isRequiredByAgent == undefined ? true : preDefProp.isRequiredByAgent
-          }));
-      } else {
-        return App.ServiceConfigProperty.create({name: name, value: value, isRequiredByAgent:
true});
-      }
-    };
-
-    var tests = [
-      {
-        stepConfigs: [
-          ['realm', ' SPACES '],
-          ['admin_server_host', ' space_left'],
-          ['kdc_host', ' space_left_and_right '],
-          ['ldap_url', 'space_right ']
-        ],
-        e: {
-          realm: 'SPACES',
-          admin_server_host: 'space_left',
-          kdc_host: 'space_left_and_right',
-          ldap_url: 'space_right'
-        }
-      }
-    ];
-
-    tests.forEach(function(test) {
-      it('Should trim values for properties ' + Em.keys(test.e).join(','), function() {
-        controller.set('stepConfigs', [
-          App.ServiceConfig.create({
-            configs: test.stepConfigs.map(function(item) { return _createProperty(item[0],
item[1]); })
-          })
-        ]);
-        var result = controller.createKerberosSiteObj('some-site', 'random-tag');
-        Em.keys(test.e).forEach(function(propertyName) {
-          expect(result.properties[propertyName]).to.be.eql(test.e[propertyName]);
-        });
-      });
-    });
-  });
-});


Mime
View raw message