瀏覽代碼

fix(host): strip space of hostnames when add hosts for hostgroup

红枫 6 年之前
父節點
當前提交
67c898f468
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      rrd/view/portal/host.py

+ 1 - 1
rrd/view/portal/host.py

@@ -123,7 +123,7 @@ def host_add_post():
         return jsonify(msg='hosts is blank')
 
     host_arr = hosts.splitlines()
-    safe_host_arr = [h for h in host_arr if h]
+    safe_host_arr = [h.strip() for h in host_arr if h]
     if not safe_host_arr:
         return jsonify(msg='hosts is blank')