瀏覽代碼

AMBARI-1160. Cannot add a hostname that has a number next to . in it. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431862 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父節點
當前提交
553f6eea3b
共有 2 個文件被更改,包括 7 次插入2 次删除
  1. 3 0
      CHANGES.txt
  2. 4 2
      ambari-web/app/controllers/wizard/step2_controller.js

+ 3 - 0
CHANGES.txt

@@ -695,6 +695,9 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-1160. Cannot add a hostname that has a number next to . in it.
+  (yusaku)
+
   AMBARI-1139. Disable Misc section in Customize Services page of the Install
   Wizard. (Srimanth Gunturi via yusaku) 
 

+ 4 - 2
ambari-web/app/controllers/wizard/step2_controller.js

@@ -43,8 +43,10 @@ App.WizardStep2Controller = Em.Controller.extend({
   }.property('manualInstall'),
 
   isHostNameValid: function (hostname) {
-    // For now hostnames that start or end with '-' are not allowed and hostname should be valid
-    return validator.isHostname(hostname) && (!(/^\-/.test(hostname) || /\-$/.test(hostname)));
+    // disabling hostname validation as we don't want to be too restrictive and disallow
+    // user's hostnames
+    // return validator.isHostname(hostname) && (!(/^\-/.test(hostname) || /\-$/.test(hostname)));
+    return true;
   },
 
   updateHostNameArr: function(){