Explorar el Código

AMBARI-12735. FE: Enable Kerberos Wizard hangs on step5 (alexantonenko)

Alex Antonenko hace 10 años
padre
commit
fdb72ccdbf
Se han modificado 2 ficheros con 11 adiciones y 1 borrados
  1. 5 1
      ambari-web/app/utils/config.js
  2. 6 0
      ambari-web/test/utils/config_test.js

+ 5 - 1
ambari-web/app/utils/config.js

@@ -1393,10 +1393,14 @@ App.config = Em.Object.create({
    * @returns {boolean}
    * @returns {boolean}
    */
    */
   shouldSupportFinal: function (serviceName, filename) {
   shouldSupportFinal: function (serviceName, filename) {
-    if (!serviceName || serviceName == 'MISC' || !filename) {
+    var unsupportedServiceNames = ['MISC', 'Cluster'];
+    if (!serviceName || unsupportedServiceNames.contains(serviceName) || !filename) {
       return false;
       return false;
     } else {
     } else {
       var stackService = App.StackService.find().findProperty('serviceName', serviceName);
       var stackService = App.StackService.find().findProperty('serviceName', serviceName);
+      if (!stackService) {
+        return false;
+      }
       var supportsFinal = this.getConfigTypesInfoFromService(stackService).supportsFinal;
       var supportsFinal = this.getConfigTypesInfoFromService(stackService).supportsFinal;
       var matchingConfigType = supportsFinal.find(function (configType) {
       var matchingConfigType = supportsFinal.find(function (configType) {
         return filename.startsWith(configType);
         return filename.startsWith(configType);

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

@@ -818,6 +818,12 @@ describe('App.config', function () {
         filename: 's0-env',
         filename: 's0-env',
         shouldSupportFinal: false,
         shouldSupportFinal: false,
         title: 'final attribute not supported'
         title: 'final attribute not supported'
+      },
+      {
+        serviceName: 'Cluster',
+        filename: 'krb5-conf.xml',
+        shouldSupportFinal: false,
+        title: 'kerberos descriptor identities don\'t support final'
       }
       }
     ];
     ];