avoid additional tb in logs when we can't connect to the external source stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 06 Jul 2009 10:42:02 +0200
branchstable
changeset 2271 5483155a1e17
parent 2270 70c0da0f2181
child 2272 f27a3a75be0d
avoid additional tb in logs when we can't connect to the external source
server/sources/pyrorql.py
--- a/server/sources/pyrorql.py	Mon Jul 06 10:32:28 2009 +0200
+++ b/server/sources/pyrorql.py	Mon Jul 06 10:42:02 2009 +0200
@@ -164,7 +164,12 @@
         """
         self.info('synchronizing pyro source %s', self.uri)
         cnx = self.get_connection()
-        extrepo = cnx._repo
+        try:
+            extrepo = cnx._repo
+        except AttributeError:
+            # fake connection wrapper returned when we can't connect to the
+            # external source (hence we've no chance to synchronize...)
+            return
         etypes = self.support_entities.keys()
         if mtime is None:
             mtime = self.last_update_time()