Jelajahi Sumber

AMBARI-18816. Ranger install asks to populate AD domain and marks its required when no AD is in play. (jaimin)

Jaimin Jetly 9 tahun lalu
induk
melakukan
e5066af0ec

+ 1 - 1
ambari-web/app/data/custom_stack_map.js

@@ -52,7 +52,7 @@ module.exports = [
   {
     "stackName": "HDF",
     "stackVersionNumber": "2.0",
-    "sign": "=",
+    "sign": ">=",
     "baseStackFolder": "HDP2.3"
   }
 ];

+ 4 - 4
ambari-web/app/utils/config.js

@@ -157,15 +157,15 @@ App.config = Em.Object.create({
     var
       baseStackFolder = App.get('currentStackName'),
       singMap = {
-        "1": ">",
-        "-1": "<",
-        "0": "="
+        "1": [">", ">="],
+        "-1": ["<", "<="],
+        "0": ["=", ">=","<="]
       };
 
     this.get('customStackMapping').every(function (stack) {
       if(stack.stackName == App.get('currentStackName')){
         var versionCompare = Em.compare(App.get('currentStackVersionNumber'), stack.stackVersionNumber);
-        if(singMap[versionCompare+""] === stack.sign){
+        if(singMap[versionCompare+""].contains(stack.sign)){
           baseStackFolder = stack.baseStackFolder;
           return false;
         }

+ 22 - 0
ambari-web/test/utils/config_test.js

@@ -126,6 +126,28 @@ describe('App.config', function () {
     });
   });
 
+  describe('#mapCustomStack', function() {
+    before(function() {
+      setups.setupStackVersion(this, 'HDF-2.2');
+    });
+
+    it('versions of HDF > 2.0 should map with HDP 2.3 stack based property definitions', function() {
+      var baseStackFolder = App.config.mapCustomStack();
+      expect(baseStackFolder).to.equal("HDP2.3");
+    });
+
+    it('versions of HDF = 2.0 should map with HDP 2.3 stack based property definitions', function() {
+      App.set('currentStackVersion', 'HDF-2.0');
+      var baseStackFolder = App.config.mapCustomStack();
+      expect(baseStackFolder).to.equal("HDP2.3");
+    });
+
+
+    after(function() {
+      setups.restoreStackVersion(this);
+    });
+  });
+
   describe('#preDefinedConfigFile', function() {
     before(function() {
       setups.setupStackVersion(this, 'BIGTOP-0.8');