AMBARI-13142 UI configs clean up. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f759df7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f759df7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f759df7 Branch: refs/heads/branch-2.1 Commit: 1f759df794d4f5a8258313e703e7481caac27f70 Parents: 4f8c717 Author: aBabiichuk <ababiic...@cybervisiontech.com> Authored: Mon Sep 21 11:46:07 2015 +0300 Committer: aBabiichuk <ababiic...@cybervisiontech.com> Committed: Mon Sep 21 11:46:07 2015 +0300 ---------------------------------------------------------------------- .../app/controllers/main/admin/security.js | 11 +- .../main/admin/security/add/step2.js | 10 +- .../main/admin/serviceAccounts_controller.js | 19 - .../controllers/main/service/info/configs.js | 63 +--- .../app/controllers/wizard/step7_controller.js | 51 +-- .../app/controllers/wizard/step8_controller.js | 214 +----------- ambari-web/app/data/BIGTOP/site_properties.js | 315 ----------------- ambari-web/app/data/HDP2/config_mapping.js | 158 --------- ambari-web/app/data/HDP2/ha_properties.js | 19 - ambari-web/app/data/HDP2/rm_ha_properties.js | 13 - ambari-web/app/data/HDP2/secure_properties.js | 156 ++++----- .../mixins/common/configs/configs_comparator.js | 3 +- .../app/mixins/common/configs/configs_saver.js | 105 ------ .../app/mixins/wizard/addSecurityConfigs.js | 6 +- .../configs/objects/service_config_property.js | 1 - ambari-web/app/utils/config.js | 345 +------------------ .../app/utils/configs/config_property_helper.js | 9 +- .../configs/service_configs_by_category_view.js | 15 +- .../main/admin/security/add/step4_test.js | 4 +- .../controllers/main/admin/security_test.js | 2 - .../admin/serviceAccounts_controller_test.js | 9 - .../main/service/info/config_test.js | 214 ------------ .../test/controllers/wizard/step7_test.js | 43 --- .../test/controllers/wizard/step8_test.js | 342 ------------------ .../mixins/wizard/addSeccurityConfigs_test.js | 6 +- .../test/mock_data_setup/configs_mock_data.js | 8 - .../objects/service_config_property_test.js | 1 - ambari-web/test/utils/config_test.js | 208 +---------- .../configs/config_property_helper_test.js | 20 +- .../service_configs_by_category_view_test.js | 4 +- 30 files changed, 141 insertions(+), 2233 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1f759df7/ambari-web/app/controllers/main/admin/security.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security.js b/ambari-web/app/controllers/main/admin/security.js index 54c257f..4d726e8 100644 --- a/ambari-web/app/controllers/main/admin/security.js +++ b/ambari-web/app/controllers/main/admin/security.js @@ -178,11 +178,11 @@ App.MainAdminSecurityController = Em.Controller.extend({ var securityUsers = this.get('serviceUsers'); if (!securityUsers || securityUsers.length < 1) { // Page could be refreshed in middle if (App.get('testMode')) { - securityUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'}); - securityUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'}); - securityUsers.pushObject({id: 'puppet var', name: 'hbase_user', value: 'hbase'}); - securityUsers.pushObject({id: 'puppet var', name: 'hive_user', value: 'hive'}); - securityUsers.pushObject({id: 'puppet var', name: 'smokeuser', value: 'ambari-qa'}); + securityUsers.pushObject({ name: 'hdfs_user', value: 'hdfs'}); + securityUsers.pushObject({ name: 'mapred_user', value: 'mapred'}); + securityUsers.pushObject({ name: 'hbase_user', value: 'hbase'}); + securityUsers.pushObject({ name: 'hive_user', value: 'hive'}); + securityUsers.pushObject({ name: 'smokeuser', value: 'ambari-qa'}); } else { this.setSecurityStatus(); securityUsers = this.get('serviceUsers'); @@ -365,7 +365,6 @@ App.MainAdminSecurityController = Em.Controller.extend({ for (var configName in defaultUserNameMap) { this.get('serviceUsers').push({ - id: 'puppet var', name: configName, value: configs[configName] || defaultUserNameMap[configName]['defaultValue'] }); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f759df7/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 e9e37ff..7626993 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step2.js +++ b/ambari-web/app/controllers/main/admin/security/add/step2.js @@ -339,11 +339,11 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({ if (Em.isNone(securityUsers) || securityUsers.length === 0) { if (App.get('testMode')) { securityUsers = securityUsers || []; - securityUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'}); - securityUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'}); - securityUsers.pushObject({id: 'puppet var', name: 'hbase_user', value: 'hbase'}); - securityUsers.pushObject({id: 'puppet var', name: 'hive_user', value: 'hive'}); - securityUsers.pushObject({id: 'puppet var', name: 'smokeuser', value: 'ambari-qa'}); + securityUsers.pushObject({ name: 'hdfs_user', value: 'hdfs'}); + securityUsers.pushObject({ name: 'mapred_user', value: 'mapred'}); + securityUsers.pushObject({ name: 'hbase_user', value: 'hbase'}); + securityUsers.pushObject({ name: 'hive_user', value: 'hive'}); + securityUsers.pushObject({ name: 'smokeuser', value: 'ambari-qa'}); } else { securityUsers = App.db.getSecureUserInfo(); } http://git-wip-us.apache.org/repos/asf/ambari/blob/1f759df7/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js index 645d7f4..8f7f48c 100644 --- a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js +++ b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js @@ -158,24 +158,5 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex } else { return arrayToSort; } - }, - /** - * set displayName of "proxyuser_group" depending on stack version - * @param misc_configs - */ - setProxyUserGroupLabel: function (misc_configs) { - var proxyUserGroup = misc_configs.findProperty('name', 'proxyuser_group'); - //stack, with version lower than 2.1, doesn't have Falcon service - if (proxyUserGroup) { - var proxyServices = ['HIVE', 'OOZIE', 'FALCON']; - var services = Em.A([]); - proxyServices.forEach(function (serviceName) { - var stackService = App.StackService.find(serviceName); - if (stackService) { - services.push(stackService.get('displayName')); - } - }, this); - proxyUserGroup.set('displayName', "Proxy group for " + stringUtils.getFormattedStringFromArray(services)); - } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/1f759df7/ambari-web/app/controllers/main/service/info/configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js index 978c03b..a8175b0 100644 --- a/ambari-web/app/controllers/main/service/info/configs.js +++ b/ambari-web/app/controllers/main/service/info/configs.js @@ -449,7 +449,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A for (var prop in config.properties) { var fileName = App.config.getOriginalFileName(config.type); var serviceConfig = allConfigs.filterProperty('name', prop).findProperty('filename', fileName); - var value = App.config.formatOverrideValue(serviceConfig, config.properties[prop]); + var value = App.config.formatPropertyValue(serviceConfig, config.properties[prop]); var isFinal = !!(config.properties_attributes && config.properties_attributes.final && config.properties_attributes.final[prop]); if (serviceConfig) { @@ -474,66 +474,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A }, /** - * @param serviceConfig - * @private - * @method checkDatabaseProperties - */ - checkDatabaseProperties: function (serviceConfig) { - this.hideHiveDatabaseProperties(serviceConfig.configs); - this.hideOozieDatabaseProperties(serviceConfig.configs); - }, - - /** - * @param configs - * @private - * @method hideHiveDatabaseProperties - */ - hideHiveDatabaseProperties: function (configs) { - if (!['HIVE'].contains(this.get('content.serviceName'))) return; - var property = configs.findProperty('name', 'hive_hostname'); - if (property) property.set('isVisible', false); - - if (configs.someProperty('name', 'hive_database')) { - var hiveDb = configs.findProperty('name', 'hive_database'); - if (hiveDb.value === 'Existing MSSQL Server database with integrated authentication') { - configs.findProperty('name', 'javax.jdo.option.ConnectionUserName').setProperties({ - isVisible: false, - isRequired: false - }); - configs.findProperty('name', 'javax.jdo.option.ConnectionPassword').setProperties({ - isVisible: false, - isRequired: false - }); - } - } - }, - - /** - * @param configs - * @private - * @method hideOozieDatabaseProperties - */ - hideOozieDatabaseProperties: function (configs) { - if (!['OOZIE'].contains(this.get('content.serviceName'))) return; - var property = configs.findProperty('name', 'oozie_hostname'); - if (property) property.set('isVisible', false); - - if (configs.someProperty('name', 'oozie_database')) { - var oozieDb = configs.findProperty('name', 'oozie_database'); - if (oozieDb.value === 'Existing MSSQL Server database with integrated authentication') { - configs.findProperty('name', 'oozie.service.JPAService.jdbc.username').setProperties({ - isVisible: false, - isRequired: false - }); - configs.findProperty('name', 'oozie.service.JPAService.jdbc.password').setProperties({ - isVisible: false, - isRequired: false - }); - } - } - }, - - /** * @param allConfigs * @private * @method onLoadOverrides @@ -569,7 +509,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A } this.set('selectedService', selectedService); this.checkOverrideProperty(selectedService); - //this.checkDatabaseProperties(selectedService); if (!App.Service.find().someProperty('serviceName', 'RANGER')) { App.config.removeRangerConfigs(this.get('stepConfigs')); } else { http://git-wip-us.apache.org/repos/asf/ambari/blob/1f759df7/ambari-web/app/controllers/wizard/step7_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 3c47866..b40a0fb 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -692,31 +692,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E } this.set('hash', this.getHash()); }, - /** - * After user navigates back to step7, values for depended configs should be set to values set by user and not to default values - * @method restoreRecommendedConfigs - */ - restoreRecommendedConfigs: function () { - var recommendationsConfigs = this.get('recommendationsConfigs') || {}; - var serviceConfigProperties = this.get('content.serviceConfigProperties') || []; - var stepConfigs = this.get('stepConfigs'); - Em.keys(recommendationsConfigs).forEach(function (file) { - (Em.keys(recommendationsConfigs[file].properties).concat(Em.keys(recommendationsConfigs[file].property_attributes || {}))).forEach(function (configName) { - stepConfigs.forEach(function (stepConfig) { - stepConfig.get('configs').filterProperty('name', configName).forEach(function (configProperty) { - if (Em.get(configProperty, 'filename').contains(file)) { - var scps = serviceConfigProperties.filterProperty('name', configName).filter(function (cp) { - return Em.get(cp, 'filename').contains(file); - }); - if (scps.length) { - Em.set(configProperty, 'value', Em.get(scps[0], 'value')); - } - } - }); - }); - }); - }); - }, /** * Mark descriptor properties in configuration object. @@ -929,25 +904,16 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E } }); //add user properties - Em.keys(configsMap).forEach(function (filename) { Em.keys(configsMap[filename]).forEach(function (propertyName) { - configs.push(configMixin.addUserProperty({ - id: 'site property', - name: propertyName, - serviceName: configMixin.getServiceNameByConfigType(filename), - value: configsMap[filename][propertyName], - savedValue: configsMap[filename][propertyName], - filename: configMixin.get('filenameExceptions').contains(filename) ? filename : filename + '.xml', - category: 'Advanced', - hasInitialValue: true, - isUserProperty: true, - isOverridable: true, - overrides: [], - isRequired: true, - isVisible: true, - showLabel: true - }, false, [])); + configs.push(configMixin.createDefaultConfig(propertyName, + configMixin.getServiceByConfigType(filename).get('serviceName'), + configMixin.getOriginalFileName(filename), + false, { + value: configsMap[filename][propertyName], + savedValue: configsMap[filename][propertyName], + hasInitialValue: true + })); }); }); }, @@ -1070,7 +1036,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E this._setEditableValue(config); this._setOverrides(config, overrides); }, this); - //this.getRecommendationsForDependencies(null, true, Em.K); }.observes('selectedConfigGroup'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/1f759df7/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index b0392fe..e149c44 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -80,18 +80,6 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz return !!App.get('router.mainAdminKerberosController.kdc_type') }.property('App.router.mainAdminKerberosController.kdc_type'), - /** - * All configs - * @type {Array} - */ - configMapping: function () { - return App.config.get('configMapping').all(true); - }.property('App.config.configMapping'), - - /** - * - */ - slaveComponentConfig: null, /** * Should Submit button be disabled @@ -231,114 +219,6 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz }, /** - * Remove unused Hive configs - * @param {Ember.Enumerable} configs - * @returns {Ember.Enumerable} - * @method removeHiveConfigs - */ - removeHiveConfigs: function (configs) { - var hiveDb = configs.findProperty('name', 'hive_database'); - var hiveDbType = configs.findProperty('name', 'hive_database_type'); - if (hiveDbType) { - var hive_properties = Em.A([]); - - switch (hiveDb.value) { - case 'New MySQL Database': - if (configs.someProperty('name', 'hive_ambari_host')) { - configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_ambari_host').value; - } - hive_properties = Em.A(['hive_existing_mysql_database', 'hive_existing_oracle_database', 'hive_existing_postgresql_database', - 'hive_existing_mssql_server_database', 'hive_existing_mssql_server_2_database']); - break; - case 'New PostgreSQL Database': - if (configs.someProperty('name', 'hive_ambari_host')) { - configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_ambari_host').value; - } - hive_properties = Em.A(['hive_existing_mysql_database', 'hive_existing_oracle_database', 'hive_existing_postgresql_database']); - break; - case 'Existing MySQL Database': - configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_mysql_host').value; - hive_properties = Em.A(['hive_ambari_database', 'hive_existing_oracle_database', 'hive_existing_postgresql_database', - 'hive_existing_mssql_server_database', 'hive_existing_mssql_server_2_database']); - break; - case Em.I18n.t('services.service.config.hive.oozie.postgresql'): - configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_postgresql_host').value; - hive_properties = Em.A(['hive_ambari_database', 'hive_existing_oracle_database', 'hive_existing_mysql_database', - 'hive_existing_mssql_server_database', 'hive_existing_mssql_server_2_database']); - break; - case 'Existing MSSQL Server database with SQL authentication': - configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_mssql_server_host').value; - hive_properties = Em.A(['hive_ambari_database', 'hive_existing_oracle_database', 'hive_existing_postgresql_database', - 'hive_existing_mysql_database', 'hive_existing_mssql_server_database', 'hive_existing_mssql_server_database']); - break; - case 'Existing MSSQL Server database with integrated authentication': - configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_mssql_server_2_host').value; - hive_properties = Em.A(['hive_ambari_database', 'hive_existing_oracle_database', 'hive_existing_postgresql_database', - 'hive_existing_mysql_database', 'hive_existing_mssql_server_database', 'hive_existing_mssql_server_2_database']); - break; - default: - configs.findProperty('name', 'hive_hostname').value = configs.findProperty('name', 'hive_existing_oracle_host').value; - hive_properties = Em.A(['hive_ambari_database', 'hive_existing_mysql_database', 'hive_existing_postgresql_database', - 'hive_existing_mssql_server_database', 'hive_existing_mssql_server_2_database']); - break; - } - - hive_properties.push('hive_master_hosts'); - configs = dataManipulationUtils.rejectPropertyValues(configs, 'name', hive_properties); - } - return configs; - }, - - /** - * Remove unused Oozie configs - * @param {Ember.Enumerable} configs - * @returns {Ember.Enumerable} - * @method removeOozieConfigs - */ - removeOozieConfigs: function (configs) { - var oozieDb = configs.findProperty('name', 'oozie_database'); - if (oozieDb) { - var oozie_properties = Em.A(['oozie_ambari_database']); - - switch (oozieDb.value) { - case 'New Derby Database': - configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_ambari_host').value; - oozie_properties = Em.A(['oozie_ambari_database', 'oozie_existing_mysql_database', 'oozie_existing_oracle_database', - 'oozie_existing_postgresql_database', 'oozie_existing_mssql_server_database', 'oozie_existing_mssql_server_2_database']); - break; - case 'Existing MySQL Database': - configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_mysql_host').value; - oozie_properties = Em.A(['oozie_ambari_database', 'oozie_existing_oracle_database', 'oozie_derby_database', - 'oozie_existing_postgresql_database', 'oozie_existing_mssql_server_database', 'oozie_existing_mssql_server_2_database']); - break; - case Em.I18n.t('services.service.config.hive.oozie.postgresql'): - configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_postgresql_host').value; - oozie_properties = Em.A(['oozie_ambari_database', 'oozie_existing_oracle_database', 'oozie_existing_mysql_database', - 'oozie_existing_mssql_server_database', 'oozie_existing_mssql_server_2_database']); - break; - case 'Existing MSSQL Server database with SQL authentication': - configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_mssql_server_host').value; - oozie_properties = Em.A(['oozie_existing_oracle_database', 'oozie_existing_postgresql_database', - 'oozie_existing_mysql_database', 'oozie_existing_mssql_server_database', 'oozie_existing_mssql_server_2_database']); - break; - case 'Existing MSSQL Server database with integrated authentication': - configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_mssql_server_2_host').value; - oozie_properties = Em.A(['oozie_existing_oracle_database', 'oozie_existing_postgresql_database', - 'oozie_existing_mysql_database', 'oozie_existing_mssql_server_database', 'oozie_existing_mssql_server_database']); - break; - default: - configs.findProperty('name', 'oozie_hostname').value = configs.findProperty('name', 'oozie_existing_oracle_host').value; - oozie_properties = Em.A(['oozie_ambari_database', 'oozie_existing_mysql_database', 'oozie_derby_database', - 'oozie_existing_postgresql_database', 'oozie_existing_mssql_server_database', 'oozie_existing_mssql_server_2_database']); - break; - } - - configs = dataManipulationUtils.rejectPropertyValues(configs, 'name', oozie_properties); - } - return configs; - }, - - /** * Load all site properties * @method loadConfigs */ @@ -362,37 +242,6 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz }, /** - * Load UI configs - * @param {Array} configMapping - * @return {Array} - * @method loadUiSideConfigs - */ - loadUiSideConfigs: function (configMapping) { - var uiConfig = []; - var dependentConfig = $.extend(true, [], configMapping.filterProperty('foreignKey')); - dependentConfig.forEach(function (_config) { - App.config.setConfigValue(uiConfig, this.get('content.serviceConfigProperties'), _config); - // generated config name using template for example `hadoop.proxyuser.hive.hosts` - var configName = _config._name || _config.name; - // property from <code>content.serviceConfigProperties</code>. This property can be added in custom-site.xml - // with the same name as propety from defined config mapping. In this case property from config mapping - // object should be ignored. - var isPropertyDefined = this.get('content.serviceConfigProperties') - .filterProperty('filename', _config.filename).someProperty('name', configName); - // ignore config mapping property if no matches for template was found or property already added by user - if(!_config.noMatchSoSkipThisConfig && !isPropertyDefined) { - uiConfig.pushObject({ - "id": "site property", - "name": configName, - "value": _config.value, - "filename": _config.filename - }); - } - }, this); - return uiConfig; - }, - - /** * Format <code>content.hosts</code> from Object to Array * @returns {Array} * @method getRegisteredHosts @@ -1020,10 +869,10 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz if (App.get('isKerberosEnabled') && !this.get('isManualKerberos')) { this.updateKerberosDescriptor(); } - } - var fileNamesToUpdate = this.get('wizardController').getDBProperty('fileNamesToUpdate'); - if (fileNamesToUpdate && fileNamesToUpdate.length) { - this.updateConfigurations(fileNamesToUpdate); + var fileNamesToUpdate = this.get('wizardController').getDBProperty('fileNamesToUpdate'); + if (fileNamesToUpdate && fileNamesToUpdate.length) { + this.updateConfigurations(fileNamesToUpdate); + } } this.createConfigurations(); this.applyConfigurationsToCluster(this.get('serviceConfigTags')); @@ -1693,61 +1542,6 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz }, /** - * proxyuser configs which depend on service - * @type {{serviceName: string, user: string}[]} - */ - optionalCoreSiteConfigs: [ - { - serviceName: 'OOZIE', - user: 'oozie_user' - }, - { - serviceName: 'HIVE', - user: 'hive_user' - }, - { - serviceName: 'HIVE', - user: 'hcat_user' - }, - { - serviceName: 'FALCON', - user: 'falcon_user' - } - ], - - /** - * push proxyuser properties to core-site if they required by dependencies - * @param coreSiteObj - * @param installedAndSelectedServices - * @return {Object} - */ - resolveProxyuserDependecies: function (coreSiteObj, installedAndSelectedServices) { - var coreSiteProperties = {}; - var optionalCoreSiteConfigs = this.get('optionalCoreSiteConfigs'); - var proxyuserGroup = this.get('configs').findProperty('name', 'proxyuser_group'); - - coreSiteObj.forEach(function (_coreSiteObj) { - //proxyuser_group property should be added only if proxyuser properties are used - if (proxyuserGroup && _coreSiteObj.name === proxyuserGroup.name) return; - - // exclude some configs if service wasn't selected - var addProperty = optionalCoreSiteConfigs.every(function (config) { - var userValue = this.get('configs').someProperty('name', config.user) ? this.get('configs').findProperty('name', config.user).value : null; - return (installedAndSelectedServices.someProperty('serviceName', config.serviceName) || - (_coreSiteObj.name != 'hadoop.proxyuser.' + userValue + '.hosts' && _coreSiteObj.name != 'hadoop.proxyuser.' + userValue + '.groups')) - }, this); - if (addProperty) { - coreSiteProperties[_coreSiteObj.name] = _coreSiteObj.value; - } - }, this); - - if (!App.isEmptyObject(coreSiteProperties) && proxyuserGroup) { - coreSiteProperties[proxyuserGroup.name] = proxyuserGroup.value; - } - return coreSiteProperties; - }, - - /** * Create Core Site object * @returns {{type: string, tag: string, properties: {}}} * @method createCoreSiteObj