[sysadmin-bin] Don't fail in case of http unavailability



commit 9615231ef35c9048d195b587ff16fec82aaf3583
Author: Andrea Veri <averi redhat com>
Date:   Thu Nov 12 23:45:58 2020 +0100

    Don't fail in case of http unavailability

 gitlab/gitlab-operations.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gitlab/gitlab-operations.py b/gitlab/gitlab-operations.py
index 7a13c12..b0be633 100755
--- a/gitlab/gitlab-operations.py
+++ b/gitlab/gitlab-operations.py
@@ -10,6 +10,7 @@ import gnome_ldap_utils as Glu
 import semi_rdf
 
 from xml.sax import SAXParseException
+from urllib.error import HTTPError
 
 exec(open("/home/admin/secret/freeipa_ro").read())
 exec(open("/home/admin/secret/gitlab_rw").read())
@@ -127,7 +128,7 @@ for project in projects:
 
     try:
         nodes = semi_rdf.read_rdf(doap_url % (project_name, default_branch, project_name))
-    except SAXParseException:
+    except (SAXParseException, HTTPError):
         nodes = ''
 
     for node in nodes:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]