# HG changeset patch # User David Douard # Date 1436513404 -7200 # Node ID 2cc74c688eb9338e6c51ebc88ff5f3515098b401 # Parent 51261952d068c4b88259958ca174175fdd53a91a [datafeed] also catch EnvironmentError when trying to load the cwclientlib config file means the config file has not been found, so fall back to the old implementation instead of crashing. diff -r 51261952d068 -r 2cc74c688eb9 server/sources/datafeed.py --- a/server/sources/datafeed.py Fri Jul 10 09:35:52 2015 +0200 +++ b/server/sources/datafeed.py Fri Jul 10 09:30:04 2015 +0200 @@ -345,9 +345,10 @@ resp = cnx.get(url) resp.raise_for_status() return URLLibResponseAdapter(StringIO.StringIO(resp.text), url) - except (ImportError, ValueError) as exc: + except (ImportError, ValueError, EnvironmentError) as exc: # ImportError: not available # ValueError: no config entry found + # EnvironmentError: no cwclientlib config file found self.source.debug(str(exc)) # no chance with cwclientlib, fall back to former implementation @@ -522,9 +523,10 @@ cnx.timeout = self.source.http_timeout self.source.info('Using cwclientlib for checking %s' % url) return cnx.get(url).status_code == 404 - except (ImportError, ValueError) as exc: + except (ImportError, ValueError, EnvironmentError) as exc: # ImportError: not available # ValueError: no config entry found + # EnvironmentError: no cwclientlib config file found self.source.debug(str(exc)) # no chance with cwclientlib, fall back to former implementation