Prechádzať zdrojové kódy

6463 Frontend changes to pass user-specified JCE path

aBabiichuk 11 rokov pred
rodič
commit
420f16be96

+ 1 - 0
ambari-web/app/config.js

@@ -28,6 +28,7 @@ App.apiPrefix = '/api/v1';
 App.defaultStackVersion = 'HDP-2.0.5';
 App.defaultLocalStackVersion = 'HDPLocal-2.0.5';
 App.defaultJavaHome = '/usr/jdk/jdk1.6.0_31';
+App.defaultJCE = 'http://public-repo-1.hortonworks.com/ARTIFACTS/jce_policy-6.zip';
 App.timeout = 180000; // default AJAX timeout
 App.maxRetries = 3; // max number of retries for certain AJAX calls
 App.bgOperationsUpdateInterval = 6000;

+ 1 - 0
ambari-web/app/controllers/installer.js

@@ -104,6 +104,7 @@ App.InstallerController = App.WizardController.extend({
     } else {
       console.log("Failed to load Services");
    }
+    App.router.get('clusterController').loadAmbariProperties();
   },
 
   stacks: [],

+ 0 - 19
ambari-web/app/controllers/wizard/step2_controller.js

@@ -350,27 +350,8 @@ App.WizardStep2Controller = Em.Controller.extend({
     return (this.get('hostsError') || this.get('sshKeyError') || this.get('sshUserError'))  ;
   }.property('hostsError', 'sshKeyError', 'sshUserError'),
 
-  setAmbariJavaHome: function(){
-    App.ajax.send({
-      name: 'ambari.service',
-      sender: this,
-      success: 'onGetAmbariJavaHomeSuccess',
-      error: 'onGetAmbariJavaHomeError'
-    });
-  },
-
-  onGetAmbariJavaHomeSuccess: function(data) {
-    this.set('content.installOptions.javaHome',data.RootServiceComponents.properties['java.home']);
-  },
-
-  onGetAmbariJavaHomeError: function() {
-    console.warn('can\'t get java.home value from server');
-    this.set('content.installOptions.javaHome',App.defaultJavaHome);
-  },
-
   saveHosts: function(){
     this.set('content.hosts', this.getHostInfo());
-    this.setAmbariJavaHome();
     App.router.send('next');
   }
 

+ 5 - 1
ambari-web/app/controllers/wizard/step8_controller.js

@@ -1365,6 +1365,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     var globalSiteProperties = {};
     var globalSiteObj = this.get('globals');
     var isHCFSSelected = this.get('selectedServices').someProperty('serviceName', 'HCFS');
+    var ambariProperties = App.router.get('clusterController.ambariProperties');
     
     // screen out the HCFS-specific global config entries when they are not required
     if (!isHCFSSelected) {
@@ -1387,7 +1388,10 @@ App.WizardStep8Controller = Em.Controller.extend({
         console.log("STEP8: value of the global property is: " + _globalSiteObj.value);
       }
       if (_globalSiteObj.name == 'java64_home') {
-        globalSiteProperties['java64_home'] = this.get('content.installOptions.javaHome');
+        globalSiteProperties['java64_home'] = ambariProperties['java.home'] ? ambariProperties['java.home'] : App.defaultJavaHome ;
+      }
+      if (_globalSiteObj.name == 'jce_policy_url') {
+        globalSiteProperties['jce_policy_url'] = ambariProperties['jce_policy.url'] ? ambariProperties['jce_policy.url'] : App.defaultJCE ;
       }
       this._recordHostOverrideFromObj(_globalSiteObj, 'global', 'version1', this);
     }, this);

+ 14 - 0
ambari-web/app/data/HDP2/global_properties.js

@@ -2054,6 +2054,20 @@ module.exports =
       "serviceName": "MISC",
       "belongsToService":[]
     },
+    {
+      "id": "puppet var",
+      "name": "jce_policy_url",
+      "displayName": "jce_policy_url",
+      "description": " ",
+      "defaultValue": " ",
+      "isRequired": true,
+      "isReconfigurable": false,
+      "displayType": "advanced",
+      "isVisible": false,
+      "domain": "global",
+      "serviceName": "MISC",
+      "belongsToService":[]
+    },
     {
       "id": "puppet var",
       "name": "run_dir",

+ 14 - 0
ambari-web/app/data/global_properties.js

@@ -2367,6 +2367,20 @@ module.exports =
       "serviceName": "MISC",
       "belongsToService":[]
     },
+    {
+      "id": "puppet var",
+      "name": "jce_policy_url",
+      "displayName": "jce_policy_url",
+      "description": " ",
+      "defaultValue": " ",
+      "isRequired": true,
+      "isReconfigurable": false,
+      "displayType": "advanced",
+      "isVisible": false,
+      "domain": "global",
+      "serviceName": "MISC",
+      "belongsToService":[]
+    },
     {
       "id": "puppet var",
       "name": "run_dir",