anaconda/modify-network-hostname-dot-illegal.patch

40 lines
1.7 KiB
Diff
Raw Normal View History

2020-06-29 15:28:10 +08:00
From 343751258b3a4b3e21cf52add5a9ddf600065835 Mon Sep 17 00:00:00 2001
From: t_feng <fengtao40@huawei.com>
Date: Fri, 19 Jun 2020 11:48:25 +0800
2020-02-06 10:04:54 +08:00
Subject: [PATCH] modify network hostname dot illegal
---
2020-06-29 15:28:10 +08:00
pyanaconda/core/regexes.py | 2 +-
pyanaconda/network.py | 2 +-
2020-02-06 12:26:11 +08:00
2 files changed, 2 insertions(+), 2 deletions(-)
2020-02-06 10:04:54 +08:00
diff --git a/pyanaconda/core/regexes.py b/pyanaconda/core/regexes.py
2020-06-29 15:28:10 +08:00
index 63ab668..f86e403 100644
2020-02-06 10:04:54 +08:00
--- 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
2020-02-06 12:26:11 +08:00
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
2020-06-29 15:28:10 +08:00
index 127a1bd..30cf2af 100644
2020-02-06 12:26:11 +08:00
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
2020-06-29 15:28:10 +08:00
@@ -119,7 +119,7 @@ def is_valid_hostname(hostname, local=False):
2020-02-06 12:26:11 +08:00
return (False, _("Host names can only contain the characters 'a-z', "
"'A-Z', '0-9', '-', or '.', parts between periods "
2020-06-29 15:28:10 +08:00
"must contain something being 63 or fewer "
- "characters and cannot start or end with '-'."))
+ "characters and cannot start or end with '.' and '-'."))
2020-02-06 12:26:11 +08:00
return (True, "")
2020-02-06 10:04:54 +08:00
--
2020-06-29 15:28:10 +08:00
2.23.0
2020-02-06 10:04:54 +08:00