Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoradvaithm <advaith.madhukar@gmail.com>2021-04-14 14:47:57 +0530
committeradvaithm <advaith.madhukar@gmail.com>2021-04-14 14:47:57 +0530
commitdf3f7af91b28c3df75e9be8f2a961a408f3e5dbb (patch)
tree3174010f5a1bf0232ead21258f88f52e83f5f8c2 /examples
parent5aad8092742d4342e76cc32d9d4049b6b8f0c1a4 (diff)
reworked mirror selection
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 53dc1f09..8be47b82 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -1,3 +1,4 @@
+from archinstall.lib.exceptions import RequirementError
import getpass, time, json, os
import archinstall
from archinstall.lib.hardware import hasUEFI
@@ -23,8 +24,12 @@ def ask_user_questions():
# Set which region to download packages from during the installation
if not archinstall.arguments.get('mirror-region', None):
- while archinstall.arguments.get("mirror-region",{}) == {}:
- archinstall.arguments['mirror-region'] = archinstall.select_mirror_regions(archinstall.list_mirrors())
+ valid_mirror = False
+ while valid_mirror == False:
+ try:
+ archinstall.arguments['mirror-region'] = archinstall.select_mirror_regions(archinstall.list_mirrors())
+ except RequirementError as e:
+ archinstall.log(e, fg="yellow")
else:
selected_region = archinstall.arguments['mirror-region']
archinstall.arguments['mirror-region'] = {selected_region : archinstall.list_mirrors()[selected_region]}