浏览代码

AMBARI-5595. Installer wizard service confog page: JS reference error encountered when ambari-agent is not installed on ambari-server host. (jaimin)

Jaimin Jetly 11 年之前
父节点
当前提交
9699b63bc8
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      ambari-web/app/controllers/wizard/step7_controller.js

+ 7 - 2
ambari-web/app/controllers/wizard/step7_controller.js

@@ -965,8 +965,13 @@ App.WizardStep7Controller = Em.Controller.extend({
    */
   getAmbariDatabaseSuccess: function (data) {
     var hiveDBHostname = this.get('stepConfigs').findProperty('serviceName', 'HIVE').configs.findProperty('name', 'hivemetastore_host').value;
-    var ambariDBInfo = JSON.stringify(data.hostComponents[0].RootServiceHostComponents.properties);
-    this.set('mySQLServerConflict', ambariDBInfo.indexOf('mysql') > 0 && ambariDBInfo.indexOf(hiveDBHostname) > 0);
+    var ambariServiceHostComponents = data.hostComponents;
+    if (!!ambariServiceHostComponents.length) {
+      var ambariDBInfo = JSON.stringify(ambariServiceHostComponents[0].RootServiceHostComponents.properties);
+      this.set('mySQLServerConflict', ambariDBInfo.indexOf('mysql') > 0 && ambariDBInfo.indexOf(hiveDBHostname) > 0);
+    } else {
+      this.set('mySQLServerConflict', false);
+    }
   },
 
   /**