Merge lp:~james-w/udd/remove-max-threads-warning into lp:udd

Proposed by James Westby on 2012-04-04
Status: Merged
Merged at revision: 571
Proposed branch: lp:~james-w/udd/remove-max-threads-warning
Merge into: lp:udd
Diff against target: 24 lines (+5/-3)
1 file modified
udd/scripts/mass_import.py (+5/-3)
To merge this branch: bzr merge lp:~james-w/udd/remove-max-threads-warning
Reviewer Review Type Date Requested Status
Jonathan Lange (community) 2012-04-04 Approve on 2012-04-04
Review via email: mp+100816@code.launchpad.net

Commit Message

Don't warn if the max threads file isn't present.

Description of the Change

Hi,

Running the importer without a max_threads file works fine, and there is a
sane default for the number of threads. Therefore we shouldn't warn if the
file is missing, only if it is present but not readable or similar.

Thanks,

James

To post a comment you must log in.
Jonathan Lange (jml) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'udd/scripts/mass_import.py'
2--- udd/scripts/mass_import.py 2012-03-23 16:56:38 +0000
3+++ udd/scripts/mass_import.py 2012-04-04 15:38:27 +0000
4@@ -1,5 +1,6 @@
5 import codecs
6 import datetime
7+import errno
8 import logging
9 import os
10 import Queue
11@@ -440,9 +441,10 @@
12 line = f.readline().strip()
13 if line:
14 nb_threads = int(line)
15- except Exception, e:
16- self.logger.warning('Error accessing max threads file %s: %s'
17- % (self.max_threads_file, str(e)))
18+ except IOError, e:
19+ if e.errno != errno.ENOENT:
20+ self.logger.warning('Error accessing max threads file %s: %s'
21+ % (self.max_threads_file, str(e)))
22 return nb_threads
23
24 def report_driver_exception(self):

Subscribers

People subscribed via source and target branches