Просмотр исходного кода

AMBARI-8421. "New MySQL Database" hive database option should not be displayed for suse11. (2nd patch) (jaimin)

Jaimin Jetly 10 лет назад
Родитель
Сommit
50342566d5

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

@@ -345,7 +345,7 @@ App.InstallerController = App.WizardController.extend({
     } else {
       this.set('isServerClientVersionMismatch', false);
     }
-    App.set('isManagedMySQLForHiveEnabled', App.config.isManagedMySQLForHiveAllowed(data.RootServiceComponents.properties['server.os_type']));
+    App.set('isManagedMySQLForHiveEnabled', App.config.isManagedMySQLForHiveAllowed(data.RootServiceComponents.properties['server.os_family']));
   },
   getServerVersionErrorCallback: function () {
     console.log('ERROR: Cannot load Ambari server version');

+ 1 - 1
ambari-web/app/controllers/main.js

@@ -150,7 +150,7 @@ App.MainController = Em.Controller.extend({
     } else {
       this.set('isServerClientVersionMismatch', false);
     }
-    App.set('isManagedMySQLForHiveEnabled', App.config.isManagedMySQLForHiveAllowed(data.RootServiceComponents.properties['server.os_type']));
+    App.set('isManagedMySQLForHiveEnabled', App.config.isManagedMySQLForHiveAllowed(data.RootServiceComponents.properties['server.os_family']));
   },
   getServerVersionErrorCallback: function () {
     console.log('ERROR: Cannot load Ambari server version');

+ 1 - 1
ambari-web/app/utils/ajax/ajax.js

@@ -1687,7 +1687,7 @@ var urls = {
     'mock': '/data/requests/host_check/jdk_name.json'
   },
   'ambari.service.load_server_version': {
-    'real': '/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents/component_version,RootServiceComponents/properties/server.os_type&minimal_response=true',
+    'real': '/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents/component_version,RootServiceComponents/properties/server.os_family&minimal_response=true',
     'mock': '/data/ambari_components/component_version.json'
   },
   'ambari.service': {

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

@@ -49,12 +49,12 @@ App.config = Em.Object.create({
 
   /**
    * Check if Hive installation with new MySQL database created via Ambari is allowed
-   * @param osType
+   * @param osFamily
    * @returns {boolean}
    */
-  isManagedMySQLForHiveAllowed: function (osType) {
+  isManagedMySQLForHiveAllowed: function (osFamily) {
     var osList = ['redhat5', 'suse11'];
-    return !osList.contains(osType);
+    return !osList.contains(osFamily);
   },
 
   /**

+ 5 - 5
ambari-web/test/controllers/installer_test.js

@@ -45,27 +45,27 @@ describe('App.InstallerController', function () {
 
     var cases = [
         {
-          osType: 'redhat5',
+          osFamily: 'redhat5',
           expected: false
         },
         {
-          osType: 'redhat6',
+          osFamily: 'redhat6',
           expected: true
         },
         {
-          osType: 'suse11',
+          osFamily: 'suse11',
           expected: false
         }
       ],
       title = 'App.isManagedMySQLForHiveEnabled should be {0} for {1}';
 
     cases.forEach(function (item) {
-      it(title.format(item.expected, item.osType), function () {
+      it(title.format(item.expected, item.osFamily), function () {
         installerController.getServerVersionSuccessCallback({
           'RootServiceComponents': {
             'component_version': '',
             'properties': {
-              'server.os_type': item.osType
+              'server.os_family': item.osFamily
             }
           }
         });

+ 5 - 5
ambari-web/test/controllers/main_test.js

@@ -26,27 +26,27 @@ describe('App.InstallerController', function () {
     var controller = App.MainController.create(),
       cases = [
         {
-          osType: 'redhat5',
+          osFamily: 'redhat5',
           expected: false
         },
         {
-          osType: 'redhat6',
+          osFamily: 'redhat6',
           expected: true
         },
         {
-          osType: 'suse11',
+          osFamily: 'suse11',
           expected: false
         }
       ],
       title = 'App.isManagedMySQLForHiveEnabled should be {0} for {1}';
 
     cases.forEach(function (item) {
-      it(title.format(item.expected, item.osType), function () {
+      it(title.format(item.expected, item.osFamily), function () {
         controller.getServerVersionSuccessCallback({
           'RootServiceComponents': {
             'component_version': '',
             'properties': {
-              'server.os_type': item.osType
+              'server.os_family': item.osFamily
             }
           }
         });

+ 5 - 5
ambari-web/test/utils/config_test.js

@@ -595,23 +595,23 @@ describe('App.config', function () {
 
     var cases = [
       {
-        osType: 'redhat5',
+        osFamily: 'redhat5',
         expected: false
       },
       {
-        osType: 'redhat6',
+        osFamily: 'redhat6',
         expected: true
       },
       {
-        osType: 'suse11',
+        osFamily: 'suse11',
         expected: false
       }
     ],
       title = 'should be {0} for {1}';
 
     cases.forEach(function (item) {
-      it(title.format(item.expected, item.osType), function () {
-        expect(App.config.isManagedMySQLForHiveAllowed(item.osType)).to.equal(item.expected);
+      it(title.format(item.expected, item.osFamily), function () {
+        expect(App.config.isManagedMySQLForHiveAllowed(item.osFamily)).to.equal(item.expected);
       });
     });