ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-12309. Kerberos: After partitially enabling manual kerb, start all fails (akovalenko)
Date Tue, 07 Jul 2015 11:07:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 ff96ed451 -> 261fd7f76


AMBARI-12309. Kerberos: After partitially enabling manual kerb, start all fails (akovalenko)


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

Branch: refs/heads/branch-2.1
Commit: 261fd7f7628d9a36135188a1d3a5fc3677d94f10
Parents: ff96ed4
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Tue Jul 7 13:47:09 2015 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Tue Jul 7 13:47:09 2015 +0300

----------------------------------------------------------------------
 .../main/admin/kerberos/step2_controller.js     | 70 ++++----------------
 .../main/admin/kerberos/wizard_controller.js    | 54 +++++++++++++++
 ambari-web/app/routes/add_kerberos_routes.js    | 15 +++--
 3 files changed, 78 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/261fd7f7/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 77ab68f..c843d9a 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -17,7 +17,6 @@
  */
 
 var App = require('app');
-var componentsUtils = require('utils/components');
 require('controllers/wizard/step7_controller');
 
 App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend({
@@ -133,7 +132,7 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend({
     var self = this;
     this.deleteKerberosService().always(function (data) {
       self.removeLocalKerberosComponentData();
-      self.createKerberosResources();
+      self.configureKerberos();
     });
   },
 
@@ -141,19 +140,21 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend({
     App.serviceComponents.removeObject('KERBEROS_CLIENT');
   },
 
-  createKerberosResources: function () {
+  configureKerberos: function () {
     var self = this;
-    this.createKerberosService().done(function () {
-      componentsUtils.createServiceComponent('KERBEROS_CLIENT').done(function () {
-        self.createKerberosHostComponents().done(function () {
-          self.createConfigurations().done(function () {
-            self.createKerberosAdminSession().done(function () {
-              App.router.send('next');
-            });
-          });
+    var wizardController = App.router.get(this.get('content.controllerName'));
+    var callback = function () {
+      self.createConfigurations().done(function () {
+        self.createKerberosAdminSession().done(function () {
+          App.router.send('next');
         });
       });
-    });
+    };
+    if (wizardController.get('skipClientInstall')) {
+      callback();
+    } else {
+      wizardController.createKerberosResources(callback);
+    }
   },
 
   /**
@@ -170,51 +171,6 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend({
     });
   },
 
-  createKerberosService: function () {
-    return App.ajax.send({
-      name: 'wizard.step8.create_selected_services',
-      sender: this,
-      data: {
-        data: '{"ServiceInfo": { "service_name": "KERBEROS"}}',
-        cluster: App.get('clusterName') || App.clusterStatus.get('clusterName')
-      }
-    });
-  },
-
-  createKerberosHostComponents: function () {
-    var hostNames = this.get('hostNames');
-    var queryStr = '';
-    hostNames.forEach(function (hostName) {
-      queryStr += 'Hosts/host_name=' + hostName + '|';
-    });
-    //slice off last symbol '|'
-    queryStr = queryStr.slice(0, -1);
-
-    var data = {
-      "RequestInfo": {
-        "query": queryStr
-      },
-      "Body": {
-        "host_components": [
-          {
-            "HostRoles": {
-              "component_name": this.componentName
-            }
-          }
-        ]
-      }
-    };
-
-    return App.ajax.send({
-      name: 'wizard.step8.register_host_to_component',
-      sender: this,
-      data: {
-        cluster: App.router.getClusterName(),
-        data: JSON.stringify(data)
-      }
-    });
-  },
-
   createConfigurations: function () {
     var service = App.StackService.find().findProperty('serviceName', 'KERBEROS');
     var serviceConfigTags = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/261fd7f7/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
index 515fc0a..510d1a0 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
@@ -18,6 +18,7 @@
 
 
 var App = require('app');
+var componentsUtils = require('utils/components');
 
 App.KerberosWizardController = App.WizardController.extend({
 
@@ -201,6 +202,59 @@ App.KerberosWizardController = App.WizardController.extend({
     this.set('kerberosDescriptorConfigs', kerberosDescriptorConfigs);
   },
 
+  createKerberosResources: function (callback) {
+    var self = this;
+    this.createKerberosService().done(function () {
+      componentsUtils.createServiceComponent('KERBEROS_CLIENT').done(function () {
+        self.createKerberosHostComponents().done(callback);
+      });
+    });
+  },
+
+  createKerberosService: function () {
+    return App.ajax.send({
+      name: 'wizard.step8.create_selected_services',
+      sender: this,
+      data: {
+        data: '{"ServiceInfo": { "service_name": "KERBEROS"}}',
+        cluster: App.get('clusterName') || App.clusterStatus.get('clusterName')
+      }
+    });
+  },
+
+  createKerberosHostComponents: function () {
+    var hostNames = App.get('allHostNames');
+    var queryStr = '';
+    hostNames.forEach(function (hostName) {
+      queryStr += 'Hosts/host_name=' + hostName + '|';
+    });
+    //slice off last symbol '|'
+    queryStr = queryStr.slice(0, -1);
+
+    var data = {
+      "RequestInfo": {
+        "query": queryStr
+      },
+      "Body": {
+        "host_components": [
+          {
+            "HostRoles": {
+              "component_name": 'KERBEROS_CLIENT'
+            }
+          }
+        ]
+      }
+    };
+
+    return App.ajax.send({
+      name: 'wizard.step8.register_host_to_component',
+      sender: this,
+      data: {
+        cluster: App.router.getClusterName(),
+        data: JSON.stringify(data)
+      }
+    });
+  },
 
   loadMap: {
     '1': [

http://git-wip-us.apache.org/repos/asf/ambari/blob/261fd7f7/ambari-web/app/routes/add_kerberos_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_kerberos_routes.js b/ambari-web/app/routes/add_kerberos_routes.js
index ef2d1e7..c7ad43d 100644
--- a/ambari-web/app/routes/add_kerberos_routes.js
+++ b/ambari-web/app/routes/add_kerberos_routes.js
@@ -167,7 +167,7 @@ module.exports = App.WizardRoute.extend({
       var kerberosWizardController = router.get('kerberosWizardController');
       if (!controller.get('isBackBtnDisabled')) {
         kerberosWizardController.overrideVisibility(controller.get('configs'), true, []);
-        router.transitionTo('step1')
+        router.transitionTo('step1');
       }
     },
 
@@ -314,9 +314,16 @@ module.exports = App.WizardRoute.extend({
     back: Em.Router.transitionTo('step4'),
     next: function (router) {
       var kerberosWizardController = router.get('kerberosWizardController');
-      kerberosWizardController.setDBProperty('tasksStatuses', null);
-      kerberosWizardController.setDBProperty('tasksRequestIds', null);
-      router.transitionTo('step7');
+      var callback = function () {
+        kerberosWizardController.setDBProperty('tasksStatuses', null);
+        kerberosWizardController.setDBProperty('tasksRequestIds', null);
+        router.transitionTo('step7');
+      };
+      if (kerberosWizardController.get('skipClientInstall')) {
+        kerberosWizardController.createKerberosResources(callback);
+      } else {
+        callback();
+      }
     }
   }),
 


Mime
View raw message