You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/12/02 16:28:48 UTC
ambari git commit: AMBARI-14155. Blueprints: Kerberos deployments
cause Kerberos UI to hang
Repository: ambari
Updated Branches:
refs/heads/trunk 08227a64e -> 1de993421
AMBARI-14155. Blueprints: Kerberos deployments cause Kerberos UI to hang
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1de99342
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1de99342
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1de99342
Branch: refs/heads/trunk
Commit: 1de9934216c653843b7e4cec9065a5c76f9b84a4
Parents: 08227a6
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Dec 2 17:25:49 2015 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Dec 2 17:28:44 2015 +0200
----------------------------------------------------------------------
.../app/controllers/main/admin/kerberos.js | 27 +++++++-------------
.../app/mixins/wizard/addSecurityConfigs.js | 19 ++++++++++++--
2 files changed, 26 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/1de99342/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 4e5bcd4..c021c89 100644
--- a/ambari-web/app/controllers/main/admin/kerberos.js
+++ b/ambari-web/app/controllers/main/admin/kerberos.js
@@ -280,25 +280,10 @@ App.MainAdminKerberosController = App.KerberosWizardStep4Controller.extend({
success: 'getSecurityStatusSuccessCallback',
error: 'errorCallback'
})
- .always(this.getSecurityType.bind(this))
- .always(function () {
- // check for kerberos descriptor artifact
- if (self.get('securityEnabled')) {
- self.loadClusterDescriptorConfigs().then(function () {
- dfd.resolve();
- }, function () {
- // if kerberos descriptor doesn't exist in cluster artifacts get the default descriptor
- self.loadStackDescriptorConfigs().then(function () {
- self.set('defaultKerberosLoaded', true);
- dfd.resolve();
- }, function () {
- self.set('securityEnabled', false);
- dfd.resolve();
- });
- });
- } else {
+ .always(function() {
+ self.getSecurityType(function() {
dfd.resolve();
- }
+ });
});
}
return dfd.promise();
@@ -421,6 +406,12 @@ App.MainAdminKerberosController = App.KerberosWizardStep4Controller.extend({
}
},
+ /**
+ * Determines security type.
+ *
+ * @param {function} [callback] callback function to execute
+ * @returns {$.Deferred|null}
+ */
getSecurityType: function (callback) {
if (this.get('securityEnabled') || App.get('isKerberosEnabled')) {
if (!this.get('kdc_type')) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/1de99342/ambari-web/app/mixins/wizard/addSecurityConfigs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/addSecurityConfigs.js b/ambari-web/app/mixins/wizard/addSecurityConfigs.js
index 59fc045..b010fcf 100644
--- a/ambari-web/app/mixins/wizard/addSecurityConfigs.js
+++ b/ambari-web/app/mixins/wizard/addSecurityConfigs.js
@@ -58,11 +58,26 @@ App.AddSecurityConfigs = Em.Mixin.create({
/**
* Generate stack descriptor configs.
+ * - Load kerberos artifacts from stack endpoint
+ * - Load kerberos artifacts from cluster resource and merge them with stack descriptor.
+ * When cluster descriptor is absent then stack artifacts used.
*
* @returns {$.Deferred}
*/
getDescriptorConfigs: function () {
- return this.loadDescriptorConfigs().pipe(this.createServicesStackDescriptorConfigs.bind(this));
+ var dfd = $.Deferred();
+ var self = this;
+ this.loadStackDescriptorConfigs().then(function(data) {
+ var stackArtifacts = data;
+ self.loadClusterDescriptorConfigs().then(function(clusterArtifacts) {
+ dfd.resolve(self.createServicesStackDescriptorConfigs($.extend(true, {}, stackArtifacts, clusterArtifacts)));
+ }, function() {
+ dfd.resolve(self.createServicesStackDescriptorConfigs(stackArtifacts));
+ });
+ }, function() {
+ dfd.reject();
+ });
+ return dfd.promise();
},
/**
@@ -330,7 +345,7 @@ App.AddSecurityConfigs = Em.Mixin.create({
}, this);
} else if (Object.keys(configurations).contains(config.name) && config.filename === 'stackConfigs') {
configurations[config.name] = config.value;
- isConfigUpdated = true
+ isConfigUpdated = true;
}
}
return isConfigUpdated;