1 Star 0 Fork 97

王策/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
modify-network-hostname-dot-illegal.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
t.feng 提交于 2020-06-29 15:28 . update version to 33.19
From 343751258b3a4b3e21cf52add5a9ddf600065835 Mon Sep 17 00:00:00 2001
From: t_feng <fengtao40@huawei.com>
Date: Fri, 19 Jun 2020 11:48:25 +0800
Subject: [PATCH] modify network hostname dot illegal
---
pyanaconda/core/regexes.py | 2 +-
pyanaconda/network.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/core/regexes.py b/pyanaconda/core/regexes.py
index 63ab668..f86e403 100644
--- a/pyanaconda/core/regexes.py
+++ b/pyanaconda/core/regexes.py
@@ -103,7 +103,7 @@ IPV4_NETMASK_WITH_ANCHORS = re.compile("^" + IPV4_NETMASK_WITHOUT_ANCHORS + "$")
# with a period, but it can end with one.
# This regex uses negative lookahead and lookback assertions to enforce the
# hyphen rules and make it way more confusing
-HOSTNAME_PATTERN_WITHOUT_ANCHORS = r'(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)(?:\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.?)'
+HOSTNAME_PATTERN_WITHOUT_ANCHORS = r'(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)(?:\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*)'
# URL Hostname
# This matches any hostname, IPv4 literal or properly encased IPv6 literal
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 127a1bd..30cf2af 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -119,7 +119,7 @@ def is_valid_hostname(hostname, local=False):
return (False, _("Host names can only contain the characters 'a-z', "
"'A-Z', '0-9', '-', or '.', parts between periods "
"must contain something being 63 or fewer "
- "characters and cannot start or end with '-'."))
+ "characters and cannot start or end with '.' and '-'."))
return (True, "")
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangce1988/anaconda.git
git@gitee.com:wangce1988/anaconda.git
wangce1988
anaconda
anaconda
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385