Explorar o código

AMBARI-3868: Add host fails after configuring NN HA with JavaScript error. (jaimin)

Jaimin Jetly %!s(int64=12) %!d(string=hai) anos
pai
achega
bf74734631
Modificáronse 1 ficheiros con 8 adicións e 4 borrados
  1. 8 4
      ambari-web/app/models/service_config.js

+ 8 - 4
ambari-web/app/models/service_config.js

@@ -272,12 +272,16 @@ App.ServiceConfigProperty = Ember.Object.extend({
         }
         break;
       case 'dfs.secondary.http.address':
-        var snnHost = masterComponentHostsInDB.findProperty('component', 'SECONDARY_NAMENODE').hostName;
-        this.setDefaultValue("(\\w*)(?=:)",snnHost);
+        var snnHost = masterComponentHostsInDB.findProperty('component', 'SECONDARY_NAMENODE');
+        if (snnHost) {
+          this.setDefaultValue("(\\w*)(?=:)",snnHost.hostName);
+        }
         break;
       case 'dfs.namenode.secondary.http-address':
-        var snnHost = masterComponentHostsInDB.findProperty('component', 'SECONDARY_NAMENODE').hostName;
-        this.setDefaultValue("(\\w*)(?=:)",snnHost);
+        var snnHost = masterComponentHostsInDB.findProperty('component', 'SECONDARY_NAMENODE');
+        if (snnHost) {
+          this.setDefaultValue("(\\w*)(?=:)",snnHost.hostName);
+        }
         break;
       case 'datanode_hosts':
         this.set('value', slaveComponentHostsInDB.findProperty('componentName', 'DATANODE').hosts.mapProperty('hostName'));