summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2017-06-07 21:51:22 +0200
committerJelle van der Waa <jelle@vdwaa.nl>2017-06-07 21:51:22 +0200
commitc5a4172113392abbcc0058f3256dccd030efbd6e (patch)
tree0a138ca6cdd30b31456a22d47208fbf05169a087
parent85a9f34cc84f58cbb22f4c0741670e8e3d3ad6d5 (diff)
downloadarchweb-c5a4172113392abbcc0058f3256dccd030efbd6e.tar.gz
archweb-c5a4172113392abbcc0058f3256dccd030efbd6e.zip
syncisos: print user friendly error
Print a user friendly error instead of traceback, a traceback is avaliable by increasing the verbosity (-v 2)
-rw-r--r--releng/management/commands/syncisos.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/releng/management/commands/syncisos.py b/releng/management/commands/syncisos.py
index f182cc33..68da87a7 100644
--- a/releng/management/commands/syncisos.py
+++ b/releng/management/commands/syncisos.py
@@ -40,7 +40,13 @@ class Command(BaseCommand):
def handle(self, *args, **options):
parser = IsoListParser()
isonames = Iso.objects.values_list('name', flat=True)
- active_isos = parser.parse(settings.ISO_LIST_URL)
+ try:
+ active_isos = parser.parse(settings.ISO_LIST_URL)
+ except IOError as e:
+ print('Unable to fetch active isos from {}'.format(settings.ISO_LIST_URL))
+ if options.get('verbosity') > 1:
+ print(e)
+ return
for iso in active_isos:
# create any names that don't already exist