Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorSecondThundeR <awayfromgalaxy@gmail.com>2021-04-20 15:02:11 +0300
committerSecondThundeR <awayfromgalaxy@gmail.com>2021-04-20 15:02:11 +0300
commit1d37e5a49e094e0117ab52813bcaa374809bdc4b (patch)
tree6f708e8c98b907b0166e31b492b691d68fa36a91 /archinstall
parent1d04c9225873e21e92bc09290653450d161e067d (diff)
Uncomment new check for gateway IP address
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/user_interaction.py36
1 files changed, 15 insertions, 21 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index f2eae530..fcdeace1 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -189,27 +189,21 @@ def ask_to_configure_network():
fg='red'
)
- if not len(gateway := input('Enter your gateway (router) IP address or leave blank for none: ').strip()):
- gateway = None
-
- # Assuming that gateway (router) IP address doesn't contain subnet,
- # we can implement this check for it
- # Implemented new check for correct IP input
-
- #gateway = input('Enter your gateway (router) IP address or leave blank for none: ').strip()
- #while 1:
- # try:
- # if len(gateway) == 0:
- # gateway = None
- # else:
- # ipaddress.ip_address(gateway)
- # break
- # except ValueError:
- # log(
- # "You need to enter a valid gateway (router) IP address.",
- # level=LOG_LEVELS.Warning,
- # fg='red'
- # )
+ gateway = input('Enter your gateway (router) IP address or leave blank for none: ').strip()
+ # Implemented new check for correct gateway IP address
+ while 1:
+ try:
+ if len(gateway) == 0:
+ gateway = None
+ else:
+ ipaddress.ip_address(gateway)
+ break
+ except ValueError:
+ log(
+ "You need to enter a valid gateway (router) IP address.",
+ level=LOG_LEVELS.Warning,
+ fg='red'
+ )
dns = None
if len(dns_input := input('Enter your DNS servers (space separated, blank for none): ').strip()):