Merge lp://staging/~bryce/launchpad/lp-796645-cron-dies-on-404 into lp://staging/launchpad
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13362 |
Proposed branch: | lp://staging/~bryce/launchpad/lp-796645-cron-dies-on-404 |
Merge into: | lp://staging/launchpad |
Diff against target: |
203 lines (+104/-25) 2 files modified
lib/lp/bugs/scripts/bzremotecomponentfinder.py (+24/-20) lib/lp/bugs/tests/test_bzremotecomponentfinder.py (+80/-5) |
To merge this branch: | bzr merge lp://staging/~bryce/launchpad/lp-796645-cron-dies-on-404 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+66541@code.staging.launchpad.net |
Commit message
[r=sinzui][bug=796645] Log warning when bug trackers are not available.
Description of the change
The update-
This merge adds a general exception handler to catch and ignore any errors thrown by the urllib2 call. This will allow data to be gathered from those bugzillas which are not broken. It does not attempt any corrections, retries, or workarounds for broken bug trackers, it just leaves any previously collected data in place and carries on.
Most of this branch is adding test code so we can synthetically test for HTTPErrors.
This merge modifies getRemoteProduc
The test code can then supply scrapers subclassed from BugzillaRemoteC
StaticTextBug
parameter. Instead of hardcoding a check for this option, we allow the
test code to provide the static text via the subclasses' getPage().
FaultyBugzill
various error codes by raising whatever errors we pass to it.
A assertGetRemote
> === modified file 'lib/lp/ bugs/scripts/ bzremotecompone ntfinder. py' bugs/scripts/ bzremotecompone ntfinder. py 2011-06-02 22:27:11 +0000 bugs/scripts/ bzremotecompone ntfinder. py 2011-07-01 02:59:24 +0000 debug(" ...Fetching page") getPage( ) error(" Error fetching %s: %s" % ( baseurl, error)) error(" Failed to access %s" % ( baseurl) )
> --- lib/lp/
> +++ lib/lp/
...
> + try:
> + self.logger.
> + page_text = bz_bugtracker.
> + except HTTPError, error:
> + self.logger.
> + lp_bugtracker.
> + continue
> + except:
> + self.logger.
> + lp_bugtracker.
> + continue
We logged code failures, or failures we can fix as errors, we issues with
other sites as warnings. The faults I saw in testing were dead sites or
bad user data...I do not think these cases are errors.