瀏覽代碼

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

Jaimin Jetly 12 年之前
父節點
當前提交
bf74734631
共有 1 個文件被更改,包括 8 次插入4 次删除
  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'));