ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-8726. Kerberos Wizard: API to kerberize cluster returns successful but without any request ID to poll for progress. (jaimin)
Date Tue, 16 Dec 2014 03:18:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8474c3497 -> 15cea53e2


AMBARI-8726. Kerberos Wizard: API to kerberize cluster returns successful but without any
request ID to poll for progress. (jaimin)


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

Branch: refs/heads/trunk
Commit: 15cea53e254db471f6562603f00867ecf3c62d48
Parents: 8474c34
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Mon Dec 15 19:18:05 2014 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Mon Dec 15 19:18:05 2014 -0800

----------------------------------------------------------------------
 .../main/admin/kerberos/step5_controller.js     | 24 +++++++++++-----
 .../main/admin/kerberos/wizard_controller.js    | 29 ++++++++++++++++++++
 ambari-web/app/routes/add_kerberos_routes.js    | 20 ++++++++++++--
 3 files changed, 63 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/15cea53e/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
index 386f9ea..eda1298 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
@@ -20,20 +20,30 @@ App.KerberosWizardStep5Controller = App.KerberosProgressPageController.extend({
   name: 'kerberosWizardStep5Controller',
   clusterDeployState: 'KERBEROS_DEPLOY',
   isSingleRequestPage: true,
-  request: function() {
-    var self = this;
-    return {
+  request: {},
+
+  setRequest: function (data, kerberosDescriptor) {
+    this.set('request', {
       name: 'KERBERIZE_CLUSTER',
       ajaxName: 'admin.kerberize.cluster',
       ajaxData: {
         data: {
-          kerberos_descriptor: self.get('content.kerberosDescriptorConfigs')
+          Clusters: {
+            desired_config: data
+          },
+          kerberos_descriptor: kerberosDescriptor
         }
       }
-    }
-  }.property('content.kerberosDescriptorConfigs'),
+    });
+  },
 
   contextForPollingRequest: Em.I18n.t('requestInfo.kerberizeCluster'),
 
-  commands: []
+  commands: [],
+
+  retry: function () {
+    this.set('showRetry', false);
+    this.get('tasks').setEach('status','PENDING');
+    App.router.send('retry');
+  }
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/15cea53e/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 a6505c7..650105e 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
@@ -67,6 +67,35 @@ App.KerberosWizardController = App.WizardController.extend({
   },
 
   /**
+   *  Gets the
+   * @returns {*} jquery promise
+   */
+  getClusterEnvData: function () {
+    var dfd = $.Deferred();
+    var self = this;
+    var siteName = 'cluster-env';
+    var tags = [{siteName: siteName}];
+    App.router.get('configurationController').getConfigsByTags(tags).done(function (data)
{
+      var properties = self.updateClusterEnvData(data[0].properties);
+      var clusterConfig = {"type": siteName, "tag": 'version' + (new Date).getTime(), "properties":
properties};
+      var clusterConfigData = {
+        Clusters: {
+          desired_config: clusterConfig
+        }
+      };
+      dfd.resolve(clusterConfigData);
+    });
+    return dfd;
+  },
+
+  updateClusterEnvData: function (configs) {
+    var kerberosDescriptor = this.get('content.kerberosDescriptorConfigs');
+    configs['security_enabled'] = true;
+    configs['kerberos_domain'] = kerberosDescriptor.properties.realm;
+    return configs;
+  },
+
+  /**
    * save status of the cluster.
    * @param clusterStatus object with status,requestId fields.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/15cea53e/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 2c1d182..1697209 100644
--- a/ambari-web/app/routes/add_kerberos_routes.js
+++ b/ambari-web/app/routes/add_kerberos_routes.js
@@ -196,9 +196,24 @@ module.exports = App.WizardRoute.extend({
     connectOutlets: function (router) {
       console.log('in kerberosWizardController.step5:connectOutlets');
       var controller = router.get('kerberosWizardController');
+      var stepController = router.get('kerberosWizardStep5Controller');
       controller.dataLoading().done(function () {
-        controller.loadAllPriorSteps();
-        controller.connectOutlet('kerberosWizardStep5', controller.get('content'));
+        controller.getClusterEnvData().done(function(data){
+          controller.loadAllPriorSteps();
+          var kerberosDescriptor = controller.get('content.kerberosDescriptorConfigs');
+          stepController.setRequest(data, kerberosDescriptor);
+          controller.connectOutlet('kerberosWizardStep5', controller.get('content'));
+        });
+      });
+    },
+    retry: function() {
+      var router = App.router;
+      var controller = router.get('kerberosWizardController');
+      controller.getClusterEnvData().done(function(data) {
+        var stepController = router.get('kerberosWizardStep5Controller');
+        var kerberosDescriptor = controller.get('content.kerberosDescriptorConfigs');
+        stepController.setRequest(data, kerberosDescriptor);
+        stepController.loadStep();
       });
     },
     unroutePath: function () {
@@ -242,5 +257,4 @@ module.exports = App.WizardRoute.extend({
 
     }
   })
-
 });


Mime
View raw message