[sysadmin-bin] ftpadmin: ignore invalid DOAP files



commit 42574a54c93df6c80708e45707a34d0ef3aba64f
Author: Olav Vitters <olav vitters nl>
Date:   Sat Mar 26 15:14:05 2011 +0100

    ftpadmin: ignore invalid DOAP files

 ftpadmin |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index efe679e..ae72b67 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -627,8 +627,12 @@ class ModuleInfo(DirectoryInfo):
     @property
     def doap(self):
         if not hasattr(self, '_doap'):
+            import xml.sax
             # Fetch DOAP file
-            self._doap = semi_rdf.read_rdf(self.DOAPURL % self.reponame)
+            try:
+                self._doap = semi_rdf.read_rdf(self.DOAPURL % self.reponame)
+            except xml.sax._exceptions.SAXParseException:
+                self._doap = []
 
         return self._doap
 



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