Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/guided.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/guided.py')
-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]}